u* tools: automatically detect the language (#1067)
authorPaul Chaignon <paul.chaignon@gmail.com>
Thu, 30 Mar 2017 17:05:40 +0000 (19:05 +0200)
committerSasha Goldshtein <goldshtn@gmail.com>
Thu, 30 Mar 2017 17:05:40 +0000 (20:05 +0300)
commit4bb6d7fe39e1beeb9602faf7668f38f18dfe1125
treea34bcfc91d4f06f5f4dfad194220e4a4295ea462
parent00f662dbea87a071714913e5c7382687fef6a508
u* tools: automatically detect the language (#1067)

* 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.
17 files changed:
src/cc/bcc_proc.c
src/cc/bcc_proc.h
src/python/bcc/libbcc.py
src/python/bcc/utils.py
tests/cc/test_c_api.cc
tests/python/test_tools_smoke.py
tests/python/test_utils.py
tools/ucalls.py
tools/ucalls_example.txt
tools/uflow.py
tools/uflow_example.txt
tools/ugc.py
tools/ugc_example.txt
tools/uobjnew.py
tools/uobjnew_example.txt
tools/uthreads.py
tools/uthreads_example.txt