1. 08 Mar, 2018 1 commit
    • Yonghong Song's avatar
      fix CMakefile for lua · 29015d7e
      Yonghong Song authored
      Issue #1621 reported an issue where bcc-lua has an unresolved
      symbol bcc_resolve_symname. This is a side effect of previous
      cmake file refactorization which permits better control
      over what features can be enabled during build time.
      The refactorization caused some symbols in bcc_syms.cc
      got lost in the final link which produced bcc-lua.
      
      This patch fixed the issue by add a new static library target
      bcc-lua-static and adds bcc_syms.cc to it when the library
      is created and hence preserved the symbol.
      
      Also removed unnecessary linking for clang_frontend library.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      29015d7e
  2. 06 Mar, 2018 3 commits
  3. 05 Mar, 2018 2 commits
  4. 04 Mar, 2018 3 commits
  5. 03 Mar, 2018 4 commits
  6. 02 Mar, 2018 2 commits
  7. 01 Mar, 2018 8 commits
  8. 28 Feb, 2018 8 commits
    • yonghong-song's avatar
      Merge pull request #1611 from palmtenor/fix_common_include · 7f99ebdf
      yonghong-song authored
      Avoid including common.h in BPFTable.h
      7f99ebdf
    • Teng Qin's avatar
      Avoid including common.h in BPFTable.h · d83805d2
      Teng Qin authored
      d83805d2
    • yonghong-song's avatar
      Merge pull request #1607 from palmtenor/no_reader · 1fe85d07
      yonghong-song authored
      Remove PERF_SAMPLE_CALLCHAIN logic from TRACEPOINT events
      1fe85d07
    • Teng Qin's avatar
      Clean-up TRACEPOINT logic from perf reader · d0e48edb
      Teng Qin authored
      d0e48edb
    • Teng Qin's avatar
      Do not use perf reader for TRACEPOINT events · fafbf3ca
      Teng Qin authored
      fafbf3ca
    • 4ast's avatar
      Merge pull request #1610 from iovisor/yhs_dev · abef8350
      4ast authored
      free llvm engine/context memory when rw_engine is not used
      abef8350
    • Yonghong Song's avatar
      free llvm engine/context memory when rw_engine is not used · af96bba7
      Yonghong Song authored
      bcc utilizes MCJIT to generate final code and the code
      is actually runnable in the process. This, however,
      may have negative memory consumption impact.
      All data will be actually allocated in memory.
      
      For example, the following large array,
        #define TCP6_RXMIT_BUCKET_BITS 18
        struct tcp6_rxmit_tbl {
          __u64 buckets[1 << TCP6_RXMIT_BUCKET_BITS];
        };
        BPF_ARRAY(rxmit_marking_map, struct tcp6_rxmit_tbl, 1);
      is added to examples/cpp/HelloWorld.cpp.
      Internally, bcc will define a structure type rxmit_marking_map_table
      with members `struct tcp6_rxmit_tbl leaf` and a variable
      with this structure type. (see src/cc/export/helpers.h),
      so that rw_engine can traverse the type to generate
      proper sscanf/snprintf functions.
      
      Even with rw_engine is disabled, the RSS still increased
      from 6MB to 12MB. The array size is roughly 2MB.
      The additional 4MB overhead is due to some llvm internal overhead
      which I did not root cause it.
      
      If rw_engine is disabled, we can actually free llvm
      engine and context memory after copying the section data.
      We do not need to copy map section data since it is not
      used later on. Only map size is needed.
      
      We cannot free llvm context memory if rw_engine is enabled since context
      is shared between regular llvm module and sscanf module.
      
      For the above HelloWorld example, if rw_engine is disabled,
      this patch is able to reduce the RSS memory from 12MB to 6MB.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      af96bba7
    • 4ast's avatar
      Merge pull request #1608 from iovisor/yhs_dev · d7814b79
      4ast authored
      setup some bpf_module data structures correctly when rw_engine is disabled
      d7814b79
  9. 27 Feb, 2018 3 commits
    • Yonghong Song's avatar
      setup some bpf_module data structures correctly when rw_engine is disabled · 31bf1c5c
      Yonghong Song authored
      Commit db7b8eb0 ("add a BPFModule API to disable rw_engine
      sscanf/snprintf functions") permits to disable rw_engine so that
      memory can be saved for structures with large arrays. As a result,
      the function BPFModule::annotate(), which is used to generate
      "sscanf" module, is not called when rw_engine is disabled.
      
      Besides generating "sscanf" module, however, BPFModule::annotate()
      also sets up several other data structures which are used for
      map/table manipulation. This patch implements BPFModule::annotate_light(),
      which will be called when rw_engine is disabled, to
      setup these data structures.
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      31bf1c5c
    • 4ast's avatar
      Merge pull request #1595 from iovisor/yhs_dev · cab4d7c6
      4ast authored
      fix hang with "trace.py --max-events #"
      cab4d7c6
    • Yonghong Song's avatar
      fix hang with "trace.py --max-events # · a7554fc4
      Yonghong Song authored
      Currently running "trace.py --max-events #" (shortname "trace.py -M #")
      will hang like below:
      
        -bash-4.2$ sudo ./trace.py -M 2 'SyS_futex'
        PID     TID     COMM            FUNC
        137727  138229  IOThreadPool0   SyS_futex
        138250  151288  OBC Dispatcher  SyS_futex
        ^C^Z
        [1]+  Stopped                 sudo ./trace.py -M 2 'SyS_futex'
        -bash-4.2$
      
      The hang happens in perf_reader_free.
      
      Commit cd5d4a6c ("fix a race condition between perf_reader
      munmap and read") fixed a race condition by adding some coordination
      between perf_reader_event_read and perf_reader_free.
      
      In this case, however, the callback function inside perf_reader_event_read
      never returns and actually calling exit(). This is because
      the maximum number of perf_events have been received. The exit()
      is calling BPF object cleanup() which calls perf_reader_free to
      free the ring buffer. perf_reader_free got stuck since it thinks
      perf_reader_event_reader did not finish yet.
      
      To fix this, a checking for thread_id is added so that
      perf_reader_free will proceed without locking if the perf_reader_read
      tid is the same as perf_reader_free since this signals that
      the callback function calls/triggers perf_reader_free.
      
      After the fix,
      
        -bash-4.2$ sudo ./trace.py -M 2 'SyS_futex'
        PID     TID     COMM            FUNC
        137727  138178  load-monitor    SyS_futex
        6359    6440    load-monitor    SyS_futex
        -bash-4.2$
      Reported-by: default avatarTeng Qin <qinteng@fb.com>
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      a7554fc4
  10. 26 Feb, 2018 3 commits
  11. 25 Feb, 2018 2 commits
  12. 24 Feb, 2018 1 commit