yotamr / traces Goto Github PK
View Code? Open in Web Editor NEWAPI tracing framework for Linux C/C++ applications
API tracing framework for Linux C/C++ applications
Trying to apply traces on my code, I get failures during linkage.
I get few errors of "no such file" (32 to be exact) of the following:
objdump: '/tmp/ccLK5eao.ltrans0.ltrans.o': No such file
and that is followed by long list of the following messages:
.o (symbol from plugin):(.text+0x0): first defined here
*.o (symbol from plugin): In function find_name': (.text+0x0): multiple definition of
null_type
I've installed clang and llvm and they seem to be in place, can you recommend a way to see if it is really installed correctly?
Thanks in advance!
I get this error when trying to compile demo app:
/mnt/space/dev/traces-dev/traces/ccwrap.py g++ -L/mnt/space/dev/traces-dev/traces demo.o ../libtraceuser.a -lrt -L. -o demo
demo.o:demo.cpp:function calculate(calculation_type, int): error: undefined reference to '__static_log_information_start'
demo.o:demo.cpp:function calculate(calculation_type, int): error: undefined reference to '__static_log_information_start'
demo.o:demo.cpp:function calculate(calculation_type, int): error: undefined reference to '__static_log_information_start'
demo.o:demo.cpp:function calculate(calculation_type, int): error: undefined reference to '__static_log_information_start'
libtrace/trace_user.c:70: error: undefined reference to '__type_information_start'
libtrace/trace_user.c:116: error: undefined reference to '__type_information_start'
libtrace/trace_user.c:255: error: undefined reference to '__type_information_start'
libtrace/trace_user.c:261: error: undefined reference to '__static_log_information_end'
collect2: error: ld returned 1 exit status
make: *** [demo] Error 1
Any ideas what's wrong? Traces libraries were compiled fine...
It seems that it really has to be exactly 3.0 -
It won't compile with clang 2.7
It won't compile with clang 3.2
I think it's a little restrictive. Either way I'd add a note about it.
/home/christer/Source/traces/ccwrap.py g++ -I.. -c -o demo.o demo.cpp
demo.o.pp.i crap
g++ -I.. -E -o demo.o.pp demo.cpp -D __TRACE_INSTRUMENTATION -include /home/chri
ster/Source/traces/trace_lib.h -include /home/christer/Source/traces/trace_user.
h
/usr/local/bin/clang -cc1 -Wno-attributes -fcolor-diagnostics -fgnu-keywords -st
d=gnu++11 -x c++ -fcxx-exceptions demo.o.pp -o demo.o.pp.i -I.. -load /home/chri
ster/Source/traces/trace_instrumentor/trace_instrumentor.so -plugin trace-instru
ment
Traceback (most recent call last):
File "/home/christer/Source/traces/ccwrap.py", line 146, in
sys.exit(main())
File "/home/christer/Source/traces/ccwrap.py", line 143, in main
os.unlink(out_pp_file)
OSError: [Errno 2] No such file or directory: 'demo.o.pp.i'
make: *** [demo.o] Error 1
I tried searching for FATAL (S keyboard shortcut) and got it:
root@guyr-ubuntu:~/traces# python interactive_reader/ui.py /mnt/box-ci13/1/mnt/logs/trace.134083499142.dump
Traceback (most recent call last):
File "interactive_reader/ui.py", line 518, in <module>
main()
File "interactive_reader/ui.py", line 515, in main
reader_ui.run(sys.argv[1])
File "interactive_reader/ui.py", line 510, in run
self.loop.run()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 170, in run
self.screen.run_wrapper(self._run)
File "/usr/lib/pymodules/python2.7/urwid/raw_display.py", line 234, in run_wrapper
return fn()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 188, in _run
self.event_loop.run()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 498, in run
self._loop()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 523, in _loop
self._watch_files[fd]()
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 234, in _update
self.process_input(keys)
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 323, in process_input
self.unhandled_input(k)
File "/usr/lib/pymodules/python2.7/urwid/main_loop.py", line 350, in unhandled_input
return self._unhandled_input(input)
File "interactive_reader/ui.py", line 484, in _handle_input
if input == 'enter' and self._main_frame.get_focus() == 'footer':
AttributeError: 'Frame' object has no attribute 'get_focus'
I get an error on this line: https://github.com/yotamr/traces/blob/master/ldwrap.py#L146 complaining that script_file is no global. I added global statements to main() and the linked function and it seems to work, but it doesn't seem like the right solution.
I have updated demo.cpp to pass an entire structure to a trace (code attached in the snapshot). However, the output of trace_dumper -o (and of trace_reader) contains an empty string for the 'test' variable. I was expecting to see the struct's fields traced.
Is this a bug in traces? Or am I doing anything wrong?
traces_demo_cpp
Update (2014.05.25)
It seems that the function format_typed_params (trace_parser.c) does not handle TRACE_PARAM_FLAG_RECORD. So, struct-like params are not being formatted in the output.
What is the correct way to trace and inspect structures?
Is there a way to perform an user defined action at function entry/exit and to exclude some functions from being traced?
Fix the wiki or fix ccwrap.py
The README file says "to produce verbose output showing function entry/leave, use the '-f' parameter".
But what filter should be passed to -f in this case? Or did you mean to write "-d" instead of "-f" because if I pass "-d" to trace_dumper I do get func enter/leave reported.
Output: error: unable to load plugin '/home/christer/Source/traces/trace_instrum
entor/trace_instrumentor.so': '/home/christer/Source/traces/trace_instrumentor/t
race_instrumentor.so: undefined symbol: _ZTIN5clang11ASTConsumerE'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.