Skip to content
Snippets Groups Projects
  1. Apr 23, 2020
  2. Oct 31, 2019
    • yonghong-song's avatar
      introduce map.lookup_or_try_init() (#2577) · 82f4302a
      yonghong-song authored
      Previously, map.lookup_or_init() may cause unexpected
      return from the function when lookup finds no element and
      init failed e.g. due to unlikely racy update or
      sometimes hash table full.
      This has caught surprise from many users. So, the commit
        https://github.com/iovisor/bcc/commit/ba64f031f2435aad5a85f8f37dbbe2a982cbbe6b
      attempts to remove the early return in map.lookup_or_init().
      But then since NULL pointer could be returned,
      user will need to change their bpf program to check return value,
      otherwise, verifier will reject the program.
      
      As described in the above, such an API behavior change may cause
      verifier failure and reject previously loadable bpf programs.
      bcc should try to maintain API stability, esp. to avoid subtle
      API behavior change.
      
      This patch propose to restore the behavior of map.lookup_or_init()
      and introduce a new one map.lookup_or_try_init(), which will
      avoid unexpected return. The name is suggested by Alexei
      to reflect that init may fail. map.lookup_or_try_init() will be formally
      documented and used in bcc. A warning will be generated if
      map.lookup_or_init() is used. Documentation will make it clear
      that map.lookup_or_try_init() is preferred over map.lookup_or_init().
      
      ```
      -bash-4.4$ sudo ./syscount.py
      /virtual/main.c:71:11: warning: lookup_or_init() may return from the function, use loopup_or_try_init() instead.
          val = data.lookup_or_init(&key, &zero);
                ^
      1 warning generated.
      Tracing syscalls, printing top 10... Ctrl+C to quit.
      ...
      ```
      
      All uses in examples and tools are converted to use
      lookup_or_try_init(). Most tests are converted to use
      lookup_or_try_init() too except test_trace_maxactive.py
      and test_tracepoint.py to test lookup_or_init()
      functionality.
  3. Sep 20, 2019
    • Philip Gladstone's avatar
      Fixes #2518 -- weird behaviour of lookup_or_init (#2520) · ba64f031
      Philip Gladstone authored
      * Allow lookup_or_init to return NULL (rather than just returning from the current function)
      * Fixed a couple of bad edits found when running tests. Also fixed a bug in the
      test runner. Also fixed a bug in libbcc where the python signature did not match
      the actual implementation.
      ba64f031
  4. Jan 16, 2019
  5. Jan 03, 2019
  6. Dec 19, 2018
  7. Oct 10, 2018
    • Marko Myllynen's avatar
      utools Tcl support (#2005) · 9f3662ee
      Marko Myllynen authored
      * Add perl* utools man page links
      
      Matches other languages, related to commit 9162be45.
      
      * uthreads: explicitly list C as supported
      
      uthreads supports C (pthreads) thread tracing, make this explicit.
      
      Earlier use of -l java and -l none unchanged.
      
      Add the corresponding man page and usage examples.
      
      * Add Tcl support for ucalls / uflow / uobjnew / ustat
      
      For some reason we need to use proc__args instead of proc__entry
      in uflow.py to get similar results as with e.g. Python.
      9f3662ee
  8. Oct 05, 2018
  9. Sep 26, 2018
  10. Sep 04, 2018
  11. Mar 02, 2018
  12. Apr 02, 2017
  13. Mar 30, 2017
    • Paul Chaignon's avatar
      u* tools: automatically detect the language (#1067) · 4bb6d7fe
      Paul Chaignon authored
      * cc: bcc function to detect the language of a process
      
      bcc_procutils_language looks into /proc/$pid/cmdline, /proc/$pid/exe,
      and /proc/$pid/maps to determine the language.
      Python wrapper takes a list of candidate languages; if the detected
      language is not part of the list, None is returned.
      
      * u* tools: automatically detect the language
      
      Uses the detect_language bcc helper. -l switch can override the
      detected language. In uthreads and ucalls, the language can be
      overwritten to 'none' to trace pthreads and syscalls respectively.
      
      All tools use the -l switch to set the language, for consistency.
      4bb6d7fe
  14. Mar 04, 2017
    • Paul Chaignon's avatar
      Travis CI build to check compliance with PEP8 (#987) · 956ca1c8
      Paul Chaignon authored
      * Travis CI build to check compliance with PEP8
      
      * argdist: linter cleanup
      
      * dbslower: linter cleanup
      
      * dbstat: linter cleanup
      
      * memleak: linter cleanup
      
      * syscount: linter cleanup
      
      * tplist: linter cleanup
      
      * trace: linter cleanup
      
      * ucalls: linter cleanup
      
      * uflow: linter cleanup
      
      * ugc: linter cleanup
      
      * uobjnew: linter cleanup
      
      * ustat: linter cleanup
      956ca1c8
  15. Feb 13, 2017
    • Sasha Goldshtein's avatar
      u* tools: Gracefully handle missing probes · dc3a57cc
      Sasha Goldshtein authored
      When the target process is missing the required USDT probes, it can
      be a simple mistake (e.g. attaching a script as Java to a Python
      process), or a runtime that is not instrumented with the required
      probes. Attempt to gracefully handle the error and print a helpful
      message instructing the user why the error might have occurred.
      
      ```
      $ uthreads -l java $(pidof python)
      Error attaching USDT probes: the specified pid might not contain
      the given language's runtime, or the runtime was not built with the
      required USDT probes. Look for a configure flag similar to
      --with-dtrace or --enable-dtrace. To check which probes are present
      in the process, use the tplist tool.
      ```
      dc3a57cc
  16. Feb 08, 2017
    • Sasha Goldshtein's avatar
      u* tools: PHP support · cfb5ee7c
      Sasha Goldshtein authored
      Introduce PHP support to ucalls, uflow, and ustat. The PHP probes
      used are for function entry and exit, file compile (~ class load),
      and exception throw. This requires a PHP runtime built with the
      `--enable-dtrace` configure switch. Some probes also require
      USE_ZEND_DTRACE=1.
      
      Resolves #945.
      cfb5ee7c
  17. Dec 19, 2016
    • Sasha Goldshtein's avatar
      uflow: Trace method execution flow · e725b14c
      Sasha Goldshtein authored
      This tool traces method executions and prints out messages
      with a nesting depth indicator that allows relatively easy
      visualization of program flow. To reduce overhead, `-C` and
      `-M` switches take class and method prefixes to filter the
      output by. The filtering takes place in the BPF program, so
      the unnecessary data never ends up in user space.
      
      Usage examples:
      
      ```
      uflow java 185
      uflow -M index python 180
      uflow -C 'IRB::Irb' ruby 10041
      ```
      e725b14c
    • Sasha Goldshtein's avatar
      tools: Script skeletons · c0217a9b
      Sasha Goldshtein authored
      Skeletons for method flow, object allocations, general
      event statistics, and thread statistics.
      c0217a9b
  18. Sep 24, 2015
Loading