Re: noob q.: trying to trace syscalls in Jessie... why do I get unselected "events" in the trace?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I've verified that /boot/config-3.16.0-4-amd64 contains e.g.:
> CONFIG_FTRACE=y
> CONFIG_FTRACE_SYSCALLS=y
> 
> 
> cat /sys/kernel/debug/tracing/README
> 
> echo 1 > /proc/sys/kernel/ftrace_enabled
> echo 1 > /sys/kernel/debug/tracing/tracing_on
> echo "function" > /sys/kernel/debug/tracing/current_tracer

This is the function tracer. It's not an event tracer. It traces
*every* function in the kernel that is not marked as notrace or is
inlined.


> 
> # disable all events possibly enabled at the moment:
> echo 0 > /sys/kernel/debug/tracing/events/enable

The above has no affect on function tracing.

> 
> # selectively enable events that are interesting to me:
> ls -l /sys/kernel/debug/tracing/events/syscalls | grep adjtime
> echo 1
> > /sys/kernel/debug/tracing/events/syscalls/sys_enter_adjtimex/enable
> > echo 1
> > > /sys/kernel/debug/tracing/events/syscalls/sys_exit_adjtimex/enable
> echo 1
> > /sys/kernel/debug/tracing/events/syscalls/sys_enter_clock_adjtime/enable
> > echo 1
> > > /sys/kernel/debug/tracing/events/syscalls/sys_exit_clock_adjtime/enable
> 
> ls -l /sys/kernel/debug/tracing/events/syscalls | grep settime
> echo 1
> > /sys/kernel/debug/tracing/events/syscalls/sys_enter_clock_settime/enable
> > echo 1
> > > /sys/kernel/debug/tracing/events/syscalls/sys_exit_clock_settime/enable
> 
> cat /sys/kernel/debug/tracing/events/set_event

The above is probably what you want, if you keep "nop" as the current_tracer.

> 
> # in my experience, I *must* set a filter, in spite of having
> # only a select few syscalls explicitly enabled for tracing (see
> above)

Yes, you must filter functions if you enable the function tracer.

> cd /sys/kernel/debug/tracing
> cat available_filter_functions | grep adjtime
> cat available_filter_functions | grep clock_settime
> echo "SyS_adjtimex compat_SyS_adjtimex"
> > /sys/kernel/debug/tracing/set_ftrace_filter echo "SyS_clock_adjtime
> > compat_SyS_clock_adjtime"
> > >> /sys/kernel/debug/tracing/set_ftrace_filter
> echo "SyS_clock_settime compat_SyS_clock_settime"
> >> /sys/kernel/debug/tracing/set_ftrace_filter cat set_ftrace_filter
> 
> # How to clear the trace filter:
> # echo >set_ftrace_filter 

Note, the above is the function tracing filter, not the event filter.

> 
> # How to view the trace log buffer:
> cat /sys/kernel/debug/tracing/trace
> tail -f /sys/kernel/debug/tracing/trace
> watch 'cat /sys/kernel/debug/tracing/trace'
> # This clears ("consumes") the trace log buffer while reading:
> cat /sys/kernel/debug/tracing/trace_pipe
> 
> # how to clear the trace log buffer:
> echo > /sys/kernel/debug/tracing/trace
> 

I think you may be getting function tracing and event tracing confused.
They are two different aspects of tracing.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-trace-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux