Man page - trace-cmd-set(1)
Packages contas this manual
- trace-cmd(1)
- trace-cmd-attach(1)
- tracecmd_buffer_instance_handle(3)
- trace-cmd-clear(1)
- tracecmd_get_first_ts(3)
- trace-cmd-stat(1)
- tracecmd_follow_missed_events(3)
- tracecmd_get_guest_cpumap(3)
- trace-cmd-check-events(1)
- tracecmd_get_tsc2nsec(3)
- trace-cmd.dat.v6(5)
- trace-cmd-convert(1)
- tracecmd_get_cpu_map(3)
- trace-cmd-sqlhist(1)
- tracecmd_get_private(3)
- tracecmd_open(3)
- tracecmd_iterate_events(3)
- tracecmd_set_loglevel(3)
- tracecmd_map_vcpus(3)
- tracecmd_open_fd(3)
- tracecmd_buffer_instances(3)
- trace-cmd-stop(1)
- tracecmd_set_private(3)
- trace-cmd-listen(1)
- trace-cmd.dat.v7(5)
- tracecmd_get_tep(3)
- tracecmd_filter_add(3)
- trace-cmd-extract(1)
- tracecmd_iterate_reset(3)
- tracecmd_map_get_private(3)
- trace-cmd-restore(1)
- trace-cmd-show(1)
- tracecmd_map_find_by_host_pid(3)
- trace-cmd-hist(1)
- tracecmd_get_traceid(3)
- tracecmd_iterate_events_multi(3)
- trace-cmd-mem(1)
- trace-cmd-report(1)
- tracecmd_read_cpu_first(3)
- trace-cmd-reset(1)
- trace-cmd-start(1)
- tracecmd_read_data(3)
- trace-cmd-agent(1)
- trace-cmd-profile(1)
- trace-cmd-dump(1)
- tracecmd_map_set_private(3)
- tracecmd_map_get_guest(3)
- trace-cmd-list(1)
- libtracecmd(3)
- tracecmd_map_get_host_pid(3)
- trace-cmd-stack(1)
- tracecmd_add_ts_offset(3)
- tracecmd_buffer_instance_name(3)
- tracecmd_read_at(3)
- tracecmd_init_data(3)
- tracecmd_open_head(3)
- trace-cmd-split(1)
- tracecmd_follow_event(3)
- trace-cmd-set(1)
- trace-cmd-snapshot(1)
- trace-cmd-stream(1)
- trace-cmd-record(1)
- tracecmd_free_record(3)
- tracecmd_close(3)
- trace-cmd-options(1)
apt-get install trace-cmd
Manual
| TRACE-CMD-SET(1) | libtracefs Manual | TRACE-CMD-SET(1) |
NAME
trace-cmd-set - set a configuration parameter of the Ftrace Linux internal tracer
SYNOPSIS
trace-cmd set [OPTIONS] [command]
DESCRIPTION
The trace-cmd(1) set command will set a configuration parameter of the Ftrace Linux kernel tracer. The specified command will be run after the ftrace state is set. The configured ftrace state can be restored to default using the trace-cmd-reset(1) command.
OPTIONS
-p tracer
-e event
The 'event' can also contain glob expressions. That is, "*stat*" will select all events (or subsystems) that have the characters "stat" in their names.
The keyword 'all' can be used to enable all events.
-T
<idle>-0 [003] 58549.289091: sched_switch: kworker/0:1:0 [120] R ==> trace-cmd:2603 [120]
<idle>-0 [003] 58549.289092: kernel_stack: <stack trace> => schedule (ffffffff814b260e) => cpu_idle (ffffffff8100a38c) => start_secondary (ffffffff814ab828)
--func-stack
-f filter
==, >=, <=, >, <, &, |, && and ||
The above are usually safe to use to compare fields.
-R trigger
See Documentation/trace/events.txt in the Linux kernel source for more information on triggers.
-v
-e: Causes all specified events to not be traced. This is useful for
selecting a subsystem to be traced but to leave out various events.
For example: "-e sched -v -e "*stat*"" will enable all events in
the sched subsystem except those that have "stat" in their names.
-B: Deletes the specified ftrace instance. There must be no
configuration options related to this instance in the command line.
For example: "-v -B bar -B foo" will delete instance bar and create
a new instance foo.
Note: the -v option was taken from the way grep(1) inverts the following
matches.
-P pid
-c
--user
-C clock
Use trace-cmd(1) list -C to see what clocks are available.
-l function-name
-g function-name
-n function-name
-d
-D
Note, this disable function tracing for all users, which includes users outside of ftrace tracers (stack_tracer, perf, etc).
-O option
-b size
-B buffer-name
After a buffer name is stated, all events added after that will be associated with that buffer. If no buffer is specified, or an event is specified before a buffer name, it will be associated with the main (toplevel) buffer.
trace-cmd set -e sched -B block -e block -B time -e timer sleep 1
The above is will enable all sched events in the main buffer. It will then create a 'block' buffer instance and enable all block events within that buffer. A 'time' buffer instance is created and all timer events will be enabled for that event.
-m size
Use this to prevent running out of diskspace for long runs.
-M cpumask
trace-cmd set -p function -M c -B events13 -e all -M 5
If the -M is left out, then the mask stays the same. To enable all CPUs, pass in a value of '-1'.
-i
-q | --quiet
--max-graph-depth depth
--cmdlines-size size
--module module
'--module snd' is equivalent to '-l :mod:snd'
'--module snd -l "*jack*"' is equivalent to '-l "*jack*:mod:snd"'
'--module snd -n "*"' is equivalent to '-n :mod:snd'
--stderr
--fork
--verbose[=level]
Example: enable all critical, error and warning logs
trace-cmd set --verbose=warning
EXAMPLES
Enable all events for tracing:
# trace-cmd set -e all
Set the function tracer:
# trace-cmd set -p function
SEE ALSO
trace-cmd(1), trace-cmd-report(1), trace-cmd-start(1), trace-cmd-stop(1), trace-cmd-extract(1), trace-cmd-reset(1), trace-cmd-split(1), trace-cmd-list(1), trace-cmd-listen(1), trace-cmd-profile(1)
AUTHOR
Written by Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com[1]>
RESOURCES
https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/
COPYING
Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL).
NOTES
- 1.
- tz.stoyanov@gmail.com
| 01/07/2025 | libtracefs |