Coder Social home page Coder Social logo

sylarserverstudy's Introduction

Sylar Network Server Study Code


C++ platform
commit stars

Introduction

A Repo with sylar network server study codes, including self-optimized codes.

Versions

  • KUbuntu 20.04
  • gcc 9.4.0 x86_64-linux-gnu
  • cmake 3.16.3

External Dependencies

  • libbacktrace and libdl (if enabled "Debug" or "RelWithDebInfo")

    libbacktrace and libdl are a linux built-in libraries.

    Note: libdl should be linked whenever boost::stacktrace is used with gcc

    It is used and linked by libsylar while

    • "Debug" or "RelWithDebInfo" is configured
    • USE_BOOST_BACKTRACE=ON

    If not compiled with debug info, we use c api ::backtrace and ::backtrace_symbol to get backtrace info.

    If we use c api ::backtrace and ::backtrace_symbol, we get things like:

    2023-02-13 17:59:54 [ERROR][root](t:146705)(f:0) tests/test_util.cc:11  ASSERTION: false
    backtrace:
     -- 0# bin/test_util(+0x2f93) [0x55f682682f93]
     -- 1# bin/test_util(+0x273f) [0x55f68268273f]
     -- 2# /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f781e0c5083]
     -- 3# bin/test_util(+0x29be) [0x55f6826829be]
    

    But if we use boost::stacktrace and libbacktrace, we can get prettier and more readable backtrace as following:

    2023-02-13 18:01:46 [ERROR][root](t:146991)(f:0) tests/test_util.cc:11  ASSERTION: false
    backtrace:
     -- 0# test_assert() at /home/windsgo/Documents/codes/SylarServerStudy/tests/test_util.cc:11
     -- 1# main at /home/windsgo/Documents/codes/SylarServerStudy/tests/test_util.cc:23
     -- 2# __libc_start_main at ../csu/libc-start.c:342
     -- 3# _start in bin/test_util
    
  • boost

    • boost::lexical_cast(header only)
    • boost::filesystem
    • boost::stacktrace(header only)(if enabled "Debug" or "RelWithDebInfo")
    sudo apt-get install libboost-all-dev
  • yaml-cpp

    sudo apt-get install libyaml-cpp-dev # recommended on ubuntu

    or

    git clone https://github.com/jbeder/yaml-cpp.git
    mkdir build && cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
    make && make install
    

sylarserverstudy's People

Contributors

windsgo avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.