Age | Commit message (Collapse) | Author | Files | Lines |
|
When -O offset is added to trace-cmd report with the function plugin
enabled, it will display the offset of the functions along with their names.
This helps in finding exactly where a function was called by its parent.
trace-cmd report -O parent -O offset
[..]
rcuc/163-1330 [163] 740.653251: function: _raw_spin_lock+0x0 <-- rcu_cpu_kthread+0x4d8
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The bash completions of trace-cmd commands uses the -h to find the options
to finish the completions with. trace-cmd listen -h had a tab before "-l"
which caused the completions to miss it. Not to mention, it caused -l not to
be in line with the other options.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The removal of malloc_or_die() cause a bad check for allocation failure for
the option of '-r'.
Fixes: b57a3336be81 ("trace-cmd: Remove malloc_or_die() form trace-read.c")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Show the available options with the bash completion of trace-cmd report -O
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Have all the trace-cmd commands have their options looked at for completion,
even if there is not a specific function to handle them.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Several trace-cmd commands use -B to work with buffer instances. When -B is
used in such a way, then have it search the instance directory and list the
available instances.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Add specific bash completion for trace-cmd show.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The commands for trace-cmd start, profile and stream are the same as
trace-cmd record, so have them have the same completions as trace-cmd record.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In the learning process of writing completion scripts, I put in various
debugging. One of those was not removed before committing.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The completions that were installed were basically just good for trace-cmd
record, which kills all other users, and makes it frustrating trying to use
tab completion for simple file finding.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When set_event_pid exists, trace-cmd uses it for filtering tasks. A commit
that updates the pid filtering was not updated to handle excludes of the
tracing, and they were added too, causing more to be filtered than what
should have been.
Fixes: a5923c5c9f81 ("trace-cmd: Filter out specific pids")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Since now there is an uniform command implementation I can reduce the
`main()` function to the minimum by using a lookup table. People can
now directly focus on a command implementation because there is
"nothing" in the `main()` function.
Link: http://lkml.kernel.org/r/20170426203028.13900-3-federico.vaga@vaga.pv.it
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Most of the commands have the implementation in a dedicated file.
Those commands without a dedicated file are implemented in the
`main()` function. This patch uniform the code by moving the commands
implemented in the `main()` function to dedicated files.
Link: http://lkml.kernel.org/r/20170426203028.13900-2-federico.vaga@vaga.pv.it
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Currently the FILTER_TRIVIAL_FALSE case has a missing break statement, if
the trivial type is FALSE, it will also run into the TRUE case, and always
be skipped as the TRUE statement will continue the loop on the inverse
condition of the FALSE statement.
Link: http://lkml.kernel.org/r/1493218540-12296-1-git-send-email-treeze.taeung@gmail.com
Reported-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Clean up compiler warning.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
To reproduce the bug
mkdir /sys/kernel/debug/tracing/instances/test
./trace-cmd show -B test -s -f
Failed to allocate instance path snapshot
Link: http://lkml.kernel.org/r/20170423102258.21609-6-federico.vaga@vaga.pv.it
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
On allocation the data structure was not initialized. Later on some
attribute of this structure are used (e.g. tsoffset) assuming that the
default value is zero, but it is not always true.
Link: http://lkml.kernel.org/r/20170423102258.21609-4-federico.vaga@vaga.pv.it
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The code was validating the string but the man page for asprintf(3)
says clearly:
--------
If memory allocation wasn't possible, or some other error occurs,
these functions will return -1, and the contents of strp are undefined.
--------
So, we cannot really rely on the returned string pointer.
Link: http://lkml.kernel.org/r/20170423102258.21609-3-federico.vaga@vaga.pv.it
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The function `load_plugin` is passed, as argument, to
`trace_util_load_plugins()` but the prototype was not exactly the same.
Link: http://lkml.kernel.org/r/20170423102258.21609-2-federico.vaga@vaga.pv.it
Signed-off-by: Federico Vaga <federico.vaga@vaga.pv.it>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
To reproduce the problem:
plugin 'wakeup'
trace-cmd: Device or resource busy
Segmentation fault (core dumped)
When the user triggers a condition such as EBUSY the program should die
gracefully. The problem here is simply caused by an extra conversion
specifier in "die" in the write_file function
Link: http://lkml.kernel.org/r/1490112713-9456-1-git-send-email-jkacur@redhat.com
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
A undefined value was being used for the OLD_RING_BUFFER_TYPE_TIME_STAMP
case entry, as the 'length' variable was not being initialized, fix it.
Caught by the reporter when building tools/perf/ using clang, which emmitted
this warning:
kbuffer-parse.c:312:7: warning: variable 'length' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case OLD_RINGBUF_TYPE_TIME_EXTEND:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
kbuffer-parse.c:339:29: note: uninitialized use occurs here
kbuf->next = kbuf->index + length;
^~~~~~
kbuffer-parse.c:297:21: note: initialize the variable 'length' to silence this warning
unsigned int length;
^
= 0
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170213121418.47f279e8@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
string.h is not needed in event-utils.h. Remove it.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This function is for external use outside of trace-cmd itself. Instead of
using the cryptic "pc" extend the name to be more meaningful, preempt_count.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Commit ce1cbc51c ("trace-cmd: Leave out absolute addresses to fix bogus
symbol resolutions") fixed up bogus symbol resolution for 'A' type
symbols used on x86_64 for percpu offsets.
However, this check did not cover per-cpu variables used in modules,
which are generated as 'local' absolute symbols, and therefore appear as 'a' in
/proc/kallsyms. Fix this.
Link: http://lkml.kernel.org/r/20170216225721.13087-1-julia@ni.com
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Julia Cartwright <julia@ni.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
My emacs highlighting gets confused by the single escaped quote, and makes
the rest of the file highlighted as if the rest of the file is part of a
string. By adding a commented out single quote, my emacs editor displays
everything nicely again.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
While trying to build trace-cmd on a box without swig installed, I get an
annoying error during build when the compile tries to build the python
plugins. Force NO_PYTHON=1 when swig is not installed, and give a warning
about it.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The profiler requires scheduler tracepoints enabled, and will bug out if
they are not. The profiler initialization will error without these
tracepoints defined. There's no reason to initialize the profiler on reading
a trace.dat file especially since it could cause that reading to fail if the
profiler required tracepoints are not there.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
To allow for better namespace of the tracecmd library, rename the parse_*()
functions to tracecmd_parse_*() to prevent namespace collisions.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
External applications that need to hook into the streaming infrastructure need a
way to have the handle init'ed in a specific way and need a way to provide their
own read function so they can intercept events. This patch adds the neccessary
definitions and hooks. Thanks,
Link: http://lkml.kernel.org/r/1448053053-24188-6-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
We need a few functions to disable/enable tracing as well as add events to be
enabled on the first instance, this patch turns a couple of these local
functions into library functions. Thanks,
Link: http://lkml.kernel.org/r/1448053053-24188-5-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
We need a way to allow external applications to create an instance for doing
their tracing, so add a helper function that takes care of creating an instance,
setting it as the main instance and doing the heavy lifting of creating the
instance in the tracing directory. Thanks,
Link: http://lkml.kernel.org/r/1448053053-24188-4-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Whenever you link against libtracecmd you will get a bunch of debugging output
if you don't provide your own pr_stat(). So instead default to no output if we
don't provide a pr_stat(). Thanks,
Link: http://lkml.kernel.org/r/1448053053-24188-3-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
[ Added missed updates for make gui ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
This allows other commands to link against trace-cmd.
Link: http://lkml.kernel.org/r/1448053053-24188-2-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The "main" functions should not be in the library, and trace-record and
trace-restore both have them. Put them back into the TRACE_CMD_OBJS and
figure out what breaks later.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add time64.h and use the time conversion macros there to keep parse-event.h
similar to the kernel tree.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Adding a missing copyright header to parse-utils.c. Assuminng that the
license is LGPL like the rest of the trace-cmd library code.
Signed-off-by: Jon Stanley <jonstanley@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1347127251-4695-1-git-send-email-jonstanley@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
As event-utils.h and parse-utils.c are copies of the same files from the
Linux kernel source tree, move the die() funtions out of them as they no
longer exist in the kernel source.
Move the functions into trace-local.h. We need to update usage() of
kernel-shark because its prototype conflicts with the usage in
trace-local.h.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
We need to include netinet/in.h to get the in6_addr struct definition, needed to
build it on the Android NDK:
In file included from event-parse.c:36:0:
/home/acme/android/android-ndk-r12/platforms/android-24/arch-arm/usr/include/netinet/ip6.h:82:18: error: field 'ip6_src' has incomplete type
struct in6_addr ip6_src; /* source address */
And it is the canonical way of getting IPv6 definitions, as described,
for instance, in Linux's 'man ipv6'
Doing that uncovers another problem: this source file uses PRIu64 but
doesn't include it, depending on it being included by chance via the now
replaced header (netinet/ip6.h), fix it.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Chris Phlipot <cphlipot0@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-tilr31n3yaba1whsd47qlwa3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
To make it portable to non-glibc systems, that follow the XSI variant
instead of the GNU specific one that gets in place when _GNU_SOURCE is
defined.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-c1gn8x978qfop65m510wy43o@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Updated to have include/linux/string.h too ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
FSF has moved, update the COPYING.LIB file.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
On failing to mount the debugfs, free the debug_str before exiting the
function.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If the strdup() fails to allocate, we exit tracecmd_find_tracing_dir()
without closing the file descriptor just opened.
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The index uesd optind instead of 'i' returning some random char.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
As the special cases in msg_do_write_check() do basically the same thing,
add a helper function to be called by them instead.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Now that debug is a global variable, there needs no function hook to tell
trace-msg.c that we are in debugging mode. Just have trace-msg.c read the
debug variable to know what to do.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Allow to debug list for agent reading.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If one application enables debugging, have all files see it.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If the size of a read is zero, do not perform the read.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
As the logic of allocating RINIT and SENDMETA on read is the same except for
sizes and where to store the dynamic data, create a helper funtion that
performs the algorithm for both of them.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Cleaned up a lot of trace-msg.c to not be fixed in the sizes. Able to
allocate only what is needed and not to be making allocation when not
needed. Also shortened a lot of local macro names as TRACECMD doesn't need
to be specified when not exported for other files to share.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Now that we leave holes in the client_pids array, we can remove the complex
logic around allocating client_pids in blocks. Just use realloc each time,
as it only grows the array, and we never shrink it.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The temp files used in put_together_file() are only used within that
function. They need to be freed before leaving that function. Funny enough,
they are freed on failure. Since the same allocations must be freed on
failure as on success, have them use the same return path.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
valgrind showed that pid_list created by create_all_readers() was never
freed. The obvious place to free it is in destroy_all_readers().
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Instead of moving around the pids in the pid list, just leave a hole. And
have the next allocation use it.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Doing a memmove in the signal handler is racy with the updates of the main
process. Especially if it does a realloc, and the memory moves. Do the clean
up from the main process instead checking for EINTR in errno.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
In case trace-cmd seg-faults right after plog(), plog() must be flush the
message to its destination before it returns, otherwise, the message could
be lost.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add page mapping infrastructure between pages and the file. This will allow
for the entire file to be mapped, or at least much more than just a page. If
the mmapping fails, a smaller mapping (of a power of 2 less, or half) will
be tried. This will continue till the mapping is the size of a page, and if
that fails then the entire report will fail (as it would now).
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Today, we only ignore section 1. But we also have a
section 5 man page.
Link: http://lkml.kernel.org/r/20161007130412.12a445e0@redhat.com
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
This commit does the following:
1. Move the code that treats "-M -1" out of set_mask()
2. Drop uneeded checks from set_mask()
3. Make instance->cpumask point to dynamic memory
This is a preparation for supporting the "--cpu-list"
option in the next commit.
Link: http://lkml.kernel.org/r/1475858831-32687-3-git-send-email-lcapitulino@redhat.com
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Future commits will introduce standard C code that
wants to use cpu.h. Let's convert cpu.h to standard
types.
I'm choosing not to change the gui code that uses
cpu.h though. I think that in all platforms where
glib is supported, guint64 should always be uint64_t
and guint should always be unsigned int.
Link: http://lkml.kernel.org/r/1475858831-32687-2-git-send-email-lcapitulino@redhat.com
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When searching the tree rows, after an item is found, it would be nice to
repeat the search with a keyboard instead of having to move the mouse back
to the entry and selecting again. Instead, have the focus come back to the
search entry box and allow the search to happen again with just hitting
"enter".
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add a -p plugin command line option for kernelshark to accept a plugin that
can modify how kernelshark works. This is just adds a loader, currently
nothing uses it yet.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If events were dropped, when hovering over the CPU plot, show that events
were missed.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Since showing interrupts for when events are in interrupts can cause the
task plots to be crazy if the interrupt events are not traced, do not do the
"in interrupt" notation unless interrupts were traced.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When testing if the plot is in irq context or not, it looks at the current
record as well as the next record to see the context. Unfortunately, if the
next record does not exist (null is returned) it would cause a crash.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The trace-cmd record command is crashing if a -f filter is used before
a -e event.
The usage a -f before a -e is a command line error, and trace-cmd
record detects this error by checking if the last_event pointer is NULL.
However, the last_event is not initialized as NULL and this command line
error is not detected. Then, the last_event is used to save the filter
options and this causes a segmentation fault because last_event was not
initialized yet.
This problem is fixed by initializing last_event as NULL.
How-to reproduce:
# trace-cmd record -f foo
Segmentation fault
Expected output:
# trace-cmd record -f foo
filter must come after event
Link: http://lkml.kernel.org/r/894eb6c8a5665fba64811395e0d1204e201f4992.1437414265.git.bristot@redhat.com
Tested-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add a 'CPU' special field to allow the filter in trace-cmd report
to filter on the task's CPU.
By adding a special field 'CPU' (all caps) the user can now
filter out tasks based on which CPU they are on. This is useful when
filtering out (or in) a bunch of threads.
-F 'CPU == 0'
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
At the end of process_filter(), collapse_tree() was changed to update
the parg parameter, but the reassignment after the call wasn't removed.
What happens is that the "current_op" gets modified and freed and parg
is assigned to the new allocated argument. But after the call to
collapse_tree(), parg is assigned again to the just freed "current_op",
and this causes the tool to crash.
The current_op variable must also be assigned to NULL in case of error,
otherwise it will cause it to be free()ed twice.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: stable@vger.kernel.org # 3.14+
Fixes: 42d6194d133c ("tools lib traceevent: Refactor process_filter()")
Link: http://lkml.kernel.org/r/20160511150936.678c18a1@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When a task was migrated to other cpu in the middle of a function, the
fgraph_exit record will be in a different cpu than the enter record.
But currently fgraph_ent_handler() only peeks at the same cpu so it
could read an incorrect record.
For example, please see following raw records:
bash-10478 [007] 73.454273: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [000] 73.454650: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x111a37483c rettime=0x111a3d0285 overrun=0x0 depth=0
bash-10478 [000] 74.456383: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [000] 74.456655: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x1155f24337 rettime=0x1155f66559 overrun=0x0 depth=0
bash-10478 [000] 75.458517: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [001] 75.458849: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x1191ad9de0 rettime=0x1191b2a6aa overrun=0x0 depth=0
bash-10478 [001] 76.460482: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [000] 76.460679: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x11cd6662b4 rettime=0x11cd695e03 overrun=0x0 depth=0
bash-10478 [000] 77.462334: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [004] 77.462564: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x12091d71c4 rettime=0x120920e977 overrun=0x0 depth=0
bash-10478 [004] 78.464315: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [001] 78.464644: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x1244d674de rettime=0x1244db7329 overrun=0x0 depth=0
bash-10478 [001] 79.466018: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [004] 79.466326: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x12808b3940 rettime=0x12808fe819 overrun=0x0 depth=0
bash-10478 [004] 80.468005: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [002] 80.468291: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x12bc44551f rettime=0x12bc48ac9a overrun=0x0 depth=0
bash-10478 [002] 81.469718: funcgraph_entry: func=0xffffffff8123bf90 depth=0
bash-10478 [007] 81.470088: funcgraph_exit: func=0xffffffff8123bf90 calltime=0x12f7f945b8 rettime=0x12f7fee028 overrun=0x0 depth=0
The first entry was call to cma_alloc function, it was on cpu 7 but the
task was migrated to cpu 0 before returning from the function.
Currently trace-cmd shows like below:
bash-10478 [007] 73.454273: funcgraph_entry: ! 367.216 us | cma_alloc();
bash-10478 [000] 73.454650: funcgraph_exit: ! 375.369 us | }
bash-10478 [000] 74.456383: funcgraph_entry: ! 270.882 us | cma_alloc();
bash-10478 [000] 75.458517: funcgraph_entry: ! 195.407 us | cma_alloc();
bash-10478 [001] 75.458849: funcgraph_exit: ! 329.930 us | }
bash-10478 [001] 76.460482: funcgraph_entry: ! 327.243 us | cma_alloc();
bash-10478 [000] 77.462334: funcgraph_entry: ! 293.465 us | cma_alloc();
bash-10478 [004] 77.462564: funcgraph_exit: ! 227.251 us | }
bash-10478 [004] 78.464315: funcgraph_entry: ! 306.905 us | cma_alloc();
bash-10478 [001] 79.466018: funcgraph_entry: ! 303.196 us | cma_alloc();
bash-10478 [004] 80.468005: funcgraph_entry: | cma_alloc() {
bash-10478 [002] 80.468291: funcgraph_exit: ! 284.539 us | }
bash-10478 [002] 81.469718: funcgraph_entry: ! 323.215 us | cma_alloc();
This is because the first funcgraph_entry on cpu 7 matched to the last
funcgraph_exit on cpu 7. And second funcgraph_exit on cpu 0 was shown
alone. We need to match record from all cpu rather than the same cpu.
In this case, entry on cpu 7 should be paired with exit on cpu 0.
With this patch, the output look like below:
bash-10478 [007] 73.454273: funcgraph_entry: ! 375.369 us | cma_alloc();
bash-10478 [000] 74.456383: funcgraph_entry: ! 270.882 us | cma_alloc();
bash-10478 [000] 75.458517: funcgraph_entry: ! 329.930 us | cma_alloc();
bash-10478 [001] 76.460482: funcgraph_entry: ! 195.407 us | cma_alloc();
bash-10478 [000] 77.462334: funcgraph_entry: ! 227.251 us | cma_alloc();
bash-10478 [004] 78.464315: funcgraph_entry: ! 327.243 us | cma_alloc();
bash-10478 [001] 79.466018: funcgraph_entry: ! 306.905 us | cma_alloc();
bash-10478 [004] 80.468005: funcgraph_entry: ! 284.539 us | cma_alloc();
bash-10478 [002] 81.469718: funcgraph_entry: ! 367.216 us | cma_alloc();
Maybe we can separate enter and exit if they happened on different
cpu. Anyway the time duration has correct value now.
Link: http://lkml.kernel.org/r/20160708055612.32221-2-namhyung@gmail.com
Reported-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Now that there's a tracecmd_peak_next_data() that is a subset of the
functionality of tracecmd_read_next_data(), have tracecmd_read_next_data()
call tracecmd_peak_next_data() and remove the duplicate code.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The tracecmd_peek_next_data() is similar to tracecmd_read_next_data()
but it doesn't consume the record.
Link: http://lkml.kernel.org/r/20160708055612.32221-1-namhyung@gmail.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Exceptions require individual decoding (only feasible intercepts
listed), XSETBV was missing and the AVIC brought in two new exit codes.
Link: http://lkml.kernel.org/r/5741D822.3030203@web.de
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
On AMD, exist code -1 is also a possible value, but we use it for
terminating the list of known exit reasons. This leads to EXIT_ERR
being reported for unkown ones. Fix this by using an NULL string
pointer as terminal.
Link: http://lkml.kernel.org/r/5741D817.3070902@web.de
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
This is exposed in debugfs but there's no quick way to set it with
trace-cmd. While we're adding support for this, fix --profile so it sets
max_graph_depth back to whatever it was before.
Link: http://lkml.kernel.org/r/52d19bb3c0daf4d03db68da438c605b318ca41a8.1466021761.git.osandov@fb.com
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
In `const char const * files[]`, both `const` refer to `char`.
Moving the second one after the `*` makes the pointer const as well,
which is probably what was intended.
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Commit 8533bda27f64 "tools lib traceevent: Split pevent_print_event()
into specific functionality functions" Broke apart the function
pevent_print_event() into three functions. The first function prints
the comm, pid and CPU, the second prints the timestamp. But that commit
added the printing of the CPU in the timestamp function, which now
causes pevent_print_event() to duplicate the CPU output.
Remove the redundant printing of the record's CPU from the timestamp
function.
Link: http://lkml.kernel.org/r/20160323101628.459375d2@gandalf.local.home
Fixes: 8533bda27f64 "tools lib traceevent: Split pevent_print_event() into specific functionality functions"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Looking at documentation on the Internet, it seems that even if a tool is
installed in /usr/local, it still should be using /var/run and /var/lib, as
those are not places that will get overrided by upgrades, but all versions
of trace-cmd should know about it.
I still keep it dynamic for installing in $HOME, as that may not be done by
a administrative user.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If prefix is "/usr" then use the "/var" directory, but for everything else
install in "$(prefix)/var".
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When trace-cmd listen is started in daemon mode, create the file
/var/run/trace-cmd-net.pid that holds the pid of the daemon.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
In order to debug the message protocol, we do not want to time out, as we
need to run gdb on the client and server, and timeouts kill the connections
we want to debug.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Have msgcpy() and optcpy() test the offset + buflen to see if it would
overwrite the size of the msg or opt. If so, return -ENIVAL. The checking of
this return value still needs to be done, but at least we wont be
accidentally overwriting the memory.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The bufcpy() wrapper to memcpy() is not very useful except that it may save
on a typecast.
Create a msgcpy() and optcpy() to use instead that is type safe and also
allows for checking of memory size overflows in the future.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Use poll(2) to wait for a message. If a client/server cannot send a message for
any reasons, the current server/client will wait in a blocking read operation.
So, we use poll(2) for avoiding remaining in a blocking state.
Changes in V4: Change the argument of tracecmd_msg_recv_wait()
Fix some typos
Link: http://lkml.kernel.org/r/20140711005829.25516.75538.stgit@yuno-kbuild.novalocal
Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Change the protocol slightly where V1 will fail right away without creating
a blank trace.dat file by appending '-1' to the V2 name. The old trace-cmd
listen will see that as a negative CPU count and bail.
Also change the hand shake a bit such that if we go to a V3, a V2 server
could just let the newer trace-cmd client know what version it can support.
Here's the update:
<server> <client>
listen to socket fd
connect to socket fd
accept the client
send "tracecmd"
+------------> receive "tracecmd"
check "tracecmd"
* send "-1V2\0"
* try_again:
* receive "-1V2" <------------+
* check "-1V2"
* if (!"-1V2") {
* if (memcmp("-1V",3))
* error();
* send "V2\0"
* goto try_again;
* }
* send "V2"
* +---------------> receive "V2"
* check "V2"
* send "<MAGIC_NUMBER>\00" as the v2 protocol
read "<MAGIC_NUMBER>\00"
* send "OK"
* +---------------> receive "OK"
* check "OK"
send cpus,pagesize,option(MSG_TINIT)
receive MSG_TINIT <-------+
print "cpus=XXX"
print "pagesize=XXX"
understand option
send port_array
+--MSG_RINIT-> receive MSG_RINIT
understand port_array
send meta data(MSG_SENDMETA)
receive MSG_SENDMETA <----+
record meta data
(snip)
send a message to finish sending meta data
| (MSG_FINMETA)
receive MSG_FINMETA <-----+
read block
--- start sending trace data on child processes ---
--- When client finishes sending trace data ---
send MSG_CLOSE
receive MSG_CLOSE <-------+
close(socket fd) close(socket fd)
The '*' represents what was updated.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
server and clients
Apply trace-msg protocol for communication between a server and clients.
Currently, trace-listen(server) and trace-record -N(client) operate as follows:
<server> <client>
listen to socket fd
connect to socket fd
accept the client
send "tracecmd"
+------------> receive "tracecmd"
check "tracecmd"
send cpus
receive cpus <------------+
print "cpus=XXX"
send pagesize
|
receive pagesize <--------+
print "pagesize=XXX"
send option
|
receive option <----------+
understand option
send port_array
+------------> receive port_array
understand port_array
send meta data
receive meta data <-------+
record meta data
(snip)
read block
--- start sending trace data on child processes ---
--- When client finishes sending trace data ---
close(socket fd)
read size = 0
close(socket fd)
All messages are unstructured character strings, so server(client) using the
protocol must parse the unstructured messages. Since it is hard to
add complex contents in the protocol, structured binary message trace-msg
is introduced as the communication protocol.
By applying this patch, server and client operate as follows:
<server> <client>
listen to socket fd
connect to socket fd
accept the client
send "tracecmd"
+------------> receive "tracecmd"
check "tracecmd"
send "V2\0<MAGIC_NUMBER>\00" as the v2 protocol
receive "V2" <------------+
check "V2"
read "<MAGIC_NUMBER>\00"
send "V2"
+---------------> receive "V2"
check "V2"
send cpus,pagesize,option(MSG_TINIT)
receive MSG_TINIT <-------+
print "cpus=XXX"
print "pagesize=XXX"
understand option
send port_array
+--MSG_RINIT-> receive MSG_RINIT
understand port_array
send meta data(MSG_SENDMETA)
receive MSG_SENDMETA <----+
record meta data
(snip)
send a message to finish sending meta data
| (MSG_FINMETA)
receive MSG_FINMETA <-----+
read block
--- start sending trace data on child processes ---
--- When client finishes sending trace data ---
send MSG_CLOSE
receive MSG_CLOSE <-------+
close(socket fd) close(socket fd)
By introducing the v2 protocol, after the client checks "tracecmd", the client
will send "V2\0<MAGIC_NUMBER>\00\0". This complex message is used when the
new client tries to connect to the old server. The new client wants to check
whether the reply message from the server is "V2" or not. However, the old
server does not respond to the client before receiving cpu numbers, page size,
and options. Each message is separated with "\0" in the old server, so the
client send "V2" as cpu numbers, "<MAGIC_NUMBER>" as page size, and "0" as
no options. On the other hands, the old server will understand the messages
as cpus=0, pagesize=<MAGIC_NUMBER>, and options=0, and then the server will
send the message "\0" as port numbers. Then, the message which the client
receives is not "V2" but "\0", so the client will reconnect to the old server
as the v1 protocol.
<How to test>
[1] Backward compatability checks
We need to test backward compatability of this patch for old
trace-cmds(client/server). So, this patch was tested for [2] command checks in
following 3 types:
<client> <server>
new old
old new
new new
[2] Command checks
- server (common)
# trace-cmd listen -p 12345
1) record
- client
# trace-cmd record -e sched -N <server IP>:12345
^C
2) record + multiple buffers
- client
# trace-cmd record -B foo -e sched -N <server IP>:12345
^C
3) extract
- client
# ./trace-cmd start -e sched
# sleep 5
# ./trace-cmd extract -N <server IP>:12345
4) extract + snapshot
- client
# ./trace-cmd start -e sched
# sleep 5
# ./trace-cmd snapshot -s
# ./trace-cmd extract -N <server IP>:12345 -s
Changes in V4: Fix some typos, cleanups and rebase for current trace-cmd-v2.4
Change the argument of tracecmd_msg_recv()
Changes in V3: Change the license of trace-msg.c to LGPL v2.1
Changes in V2: Regacy porotocol support in order to keep backward compatibility
Link: http://lkml.kernel.org/r/20140711005826.25516.77711.stgit@yuno-kbuild.novalocal
Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
This will keep trace-cmd default completion behave like before.
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
"-e", "-p" and "-{l|n|g}" are frequently used parameters in many
sub-commands, adding auto-completion support for them.
It may be very slow when triggering "-{l|n|g}" auto completion. However,
it's better than nothing.
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Having the hard irq integer arrays be set to null_int_array requires that
they are not freed with the normal free() function, but needs to check that
they have been allocated and does not equal to the null_int_array variable.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If there are no irq events, the task plots will crash as it will try to
dereference the irq array, which would still be NULL.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
This is the most simplified version. Only pop up sub-cmds and nothing
else.
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If --ts-diff is added to trace-cmd report, it will show the delta between
events. It doesn't matter which CPUs they are on. In case of filtering, the
delta is still only between the visible events.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
functions
Currently there's a single function that is used to display a record's
data in human readable format. That's pevent_print_event().
Unfortunately, this gives little room for adding other output within
the line without updating that function call.
I've decided to split that function into 3 parts.
pevent_print_event_task() which prints the task comm, pid and the CPU
pevent_print_event_time() which outputs the record's timestamp
pevent_print_event_data() which outputs the rest of the event data.
pevent_print_event() now simply calls these three functions.
To save time from doing the search for event from the record's type, I
created a new helper function called pevent_find_event_by_record(),
which returns the record's event, and this event has to be passed to
the above functions.
Link: http://lkml.kernel.org/r/20160229090128.43a56704@gandalf.local.home
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When evaluating values for print flags, if the value included a '~'
operator, the parsing would fail. This broke kmalloc's parsing of:
__print_flags(REC->gfp_flags, "|", {(unsigned
long)((((((( gfp_t)(0x400000u|0x2000000u)) | (( gfp_t)0x40u) |
(( gfp_t)0x80u) | (( gfp_t)0x20000u)) | (( gfp_t)0x02u)) |
(( gfp_t)0x08u)) | (( gfp_t)0x4000u) | (( gfp_t)0x10000u) |
(( gfp_t)0x1000u) | (( gfp_t)0x200u)) & ~(( gfp_t)0x2000000u))
^
|
here
Link: http://lkml.kernel.org/r/20160226181328.22f47129@gandalf.local.home
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The operation '%' is not implemented on event-parse.c, causing an error
when parsing events with '%' the operation in its printk format. For
example,
# perf record -e sched:sched_deadline_yield ~/yield-test
Warning: [sched:sched_deadline_yield] unknown op '%'
....
# perf script
Warning: [sched:sched_deadline_yield] unknown op '%'
test 1641 [006] 3364.109319: sched:sched_deadline_yield: \
[FAILED TO PARSE] now=3364109314595 \
deadline=3364139295135 runtime=19975597
This patch implements the '%' operation. With this patch, we see the
correct output:
# perf record -e sched:sched_deadline_yield ~/yield-test
No Warning
# perf script
yield-test 4005 [001] 4623.650978: sched:sched_deadline_yield: \
now=4623.650974050 \
deadline=4623.680957364 remaining_runtime=19979611
Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Juri Lelli <juri.lelli@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
Link: http://lkml.kernel.org/r/5c96a395c56cea6d3d13d949051bdece86cc26e0.1456157869.git.bristot@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If there's no memory available, handle_end_event() will return a NULL task,
which needs to be checked before it is dereferenced.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Commit 6fdff2ae98a0 "trace-cmd profiler: Removed malloc_or_die()"
was a bit too aggressive in having failed mallocs exit out of called
functions where it returned NULL when it should not have, which caused an
segfault.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Sometimes it is a good idea to filter out events from the recording processes
and even other pids, for example an external app that links against libtracecmd
that watches syscalls probably doesn't want its own syscalls showing up in the
events. So add the ability to filter _out_ certain pids for the events that are
enabled. The recorder threads will add their pids to this list, but they are
only filtered if the library consumer filters out a pid or if the trace-cmd
record user tries to filter anything out.
Link: http://lkml.kernel.org/r/1449248618-30556-1-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If you link against libtracecmd you get a few extraneous warnings and printf's
that aren't related to your tool. So by default make the path to the events you
are tracing use pr_stat() so if it's not defined we don't get the output, and
make the weak warning() do nothing by default. The trace-cmd stuff has this
defined so it'll continue to work normally, it just won't be noisy for consumers
of libtracecmd.
Link: http://lkml.kernel.org/r/1449243450-4280-1-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
In version trace-cmd-stable-v2.2 it is possible to call free on
tracing and path more than once.
Ensure this only happens once by moving this block to after the call
to out_free
Link: http://lkml.kernel.org/r/alpine.LFD.2.20.1512032331580.20385@riemann
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When using clocks such as x86-tsc, where the clock frequency is known, the
user can convert the timestamps into readable seconds, with resolution down
to nanoseconds.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add an option to allow users to add a timestamp offset to all events. This
is useful when wanting to merge the resulting trace.dat file with another
trace.dat file where the timestamps are shifted by a given offset.
Specifically for virtual machines, where the host and guest have a known
offset, and the recording of the host (or guest) can use this option to
remove the need to add it when merging the trace.dat files together.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When merging two or more data files, if the timestamp difference between
them are known, add the --ts-offset option to let the user specify the
offset from one data file to the next. This helps merging trace data files
from hosts and guests where the timestamp offset is a known value.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Have the task plots display when they are in interrupt context. If two
events together have their HARDIRQ flags set, then the box that fills them
will be hollow. When the cursor is over that hollow box, it will display in
the info box "(in interrupt)" to let users know why its hollow.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The -S option in trace-cmd report will not print events if the SOFTIRQ flag
is set. It does not affect hard interrupts.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The -I option in trace-cmd report will not print events if the HARDIRQ flag
is set. It does not affect softirqs.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add a way to retrieve the preempt count as well as the latency flags from a
pevent_record.
int pevent_data_pc(pevent, record);
returns the preempt count of a record.
int pevent_data_flags(pevent, record);
returns the latency flags for a record.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add a display to show an events data in a popup window for the event list.
Add both a normal event output and a raw event.
The normal event is useful when an event has more than one line,
like stack traces, as the rows still don't work quite right.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The task state now includes a flag for when its preempted. This causes
the task plot to not denote the task was preempted (rather ironic).
Mask out the bits that are still allow us to see this is TASK_RUNNING.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When doing function_graph tracing, have the -n not do the call trace
of the listed functions, instead of just skipping the specific functions
but still tracing the children of those functions.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
It appears that showing the window widget calls the configure event for
the graph, which does the calculation of all the events. Then in
gtk_main() that is called again, with a slightly different width
(perhaps the window manager changed it?). This causes the same calculations
to happen again. When it takes 15 seconds (or more) to draw the graph
due to millions of events, doubling the time is quite annoying.
Add a flag to not draw the events the first time through. Then draw them
from then on.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Instead of calculating the resolution of time vs pixels several times,
do it in draw_plot() and pass it to the box and line.
This also fixes the "scattered" lines when events overlap.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When drawing the graph, if the resolution is so low that more than one event
are on the same pixels, don't bother drawing the lines.
This is a 30% speed up.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
In order to find ways to optimize the drawing of the graph when there are
millions of events, time how long it takes to draw. If TIME_DRAW is set
then print the result. This may later turn into a debug option as well.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Change the debug output of the resolution to 16 digits instead of the
default of 8, as most of the time it is smaller than 8 decimal places.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Instead of passing in an info structure to the plot_event() code, have
the structure part of the plot structure itself. Then it can have
static data across calls.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
There were several code warnings while compiling. Clean most of them up.
Some were not cleaned up because the unused code is there as a place holder
for future development.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The new name is irq_poll as iopoll is already taken. Better suggestions
welcome.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Running the following perf-stat command on an arm64 system produces the
following result...
[root@aarch64 ~]# perf stat -e kmem:mm_page_alloc -a sleep 1
Warning: [kmem:mm_page_alloc] function sizeof not defined
Warning: Error: expected type 4 but read 0
Segmentation fault
[root@aarch64 ~]#
The second warning was a result of the first warning not stopping
processing after it detected the issue.
That is, code that found the issue reported the first problem, but
because it did not exit out of the functions smoothly, it caused the
other warning to appear and not only that, it later caused the SIGSEGV.
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20150820151632.13927.13791.email-sent-by-dnelson@teal
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
machines
When a long value is read on 32 bit machines for 64 bit output, the
parsing needs to change "%lu" into "%llu", as the value is read
natively.
Unfortunately, if "%llu" is already there, the code will add another "l"
to it and fail to parse it properly.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20151116172516.4b79b109@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When a trace recorded on a 32-bit device is processed with a 64-bit
binary, the higher 32-bits of the address need to ignored.
The lack of this results in the output of the 64-bit pointer
value to the trace as the 32-bit address lookup fails in find_printk().
Before:
burn-1778 [003] 548.600305: bputs: 0xc0046db2s: 2cec5c058d98c
After:
burn-1778 [003] 548.600305: bputs: 0xc0046db2s: RT throttling activated
The problem occurs in PRINT_FIELD when the field is recognized as a
pointer to a string (of the type const char *)
Heterogeneous architectures cases below can arise and should be handled:
* Traces recorded using 32-bit addresses processed on a 64-bit machine
* Traces recorded using 64-bit addresses processed on a 32-bit machine
Reported-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Javi Merino <javi.merino@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1442928123-13824-1-git-send-email-kapileshwar.singh@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Commits such as 65dd297ac25565 ("xfs: %pF is only for function
pointers") caused a regression because pretty_print() didn't support
%ps/%pS. The current %pf/%pF implementation in pretty_print() is what
%ps/%pS is supposed to do, so use the same code for %ps/%pS.
Addressing the incorrect %pf/%pF implementation is beyond the scope of
this patch.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Dave Chinner <david@fromorbit.com>
Link: http://lkml.kernel.org/r/20150831211637.GA12848@home.buserror.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The print_event_field() and print_event_fields() functions print basic
information of a given field or event without the print format. They'll
be used by dynamic sort keys later.
Committer note:
Rename it to pevent_print_field[s]() to get proper namespacing, as
discussed with Steven Rostedt.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1450876121-22494-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Support helper function __get_dynamic_array_len() in libtraceevent, this
function is used accompany with __print_array() or __print_hex(), but
currently it is not an available function in the function list of
process_function().
The total allocated length of the dynamic array is embedded in the top
half of __data_loc_##item field. This patch adds new arg type
PRINT_DYNAMIC_ARRAY_LEN to return the length to eval_num_arg(),
Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1440822125-52691-32-git-send-email-wangnan0@huawei.com
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The perf tools have a symbol resolver that includes solving kernel
symbols using either kallsyms or ELF symtabs, and it also is using
libtraceevent to format the trace events fields, including via
subsystem specific plugins, like the "timer" one.
To solve fields like "timer:hrtimer_start"'s "function", libtraceevent
needs a way to map from its value to a function name and addr.
This patch provides a way for tools that already have symbol resolving
facilities to ask libtraceevent to use it when needing to resolve
kernel symbols.
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-fdx1fazols17w5py26ia3bwh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If the event-fork option exists, then the kernel can handle children of
filtered event tasks, and trace-cmd does not need to play with ptrace to
monitor every time a task forks. This also allows the use of tracing
children of tasks being filtered with just -P.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The new set_event_pid file allows the use of filtering pids without needing
to add to event filters directly. By adding a pid to the set_event_pid file,
it will filter all events on the pids listed. It is much more efficient than
the event filter files, and they can handle many more pids than the filter
files can. In fact, this was tested with hackbench, and it was able to still
cope.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Fix ptrace_wait() when NO_PTRACE=1 is defined.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Some files require truncation to happen to make them do anything, like
writing "" to them. For reseting the files (and writing to debugfs files in
general), open with O_TRUNC, to reset them as they are opened.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If -k is set on the command line, not only do not update the reset_files
list, but also do not call the update of the file even if the reset_files
has something in it. This allows for reset_save_file() to be used during the
parameter parsing before -k may be used.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When a long value is read on 32 bit machines for 64 bit output, the parsing
needs to change "%lu" into "%llu", as the value is read natively.
Unfortunately, if "%llu" is already there, the code will add another "l" to
it and fail to parse it properly.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
As trace-util is more of a library type file, have its functions return
error codes and not just die on error.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Remove the use cases of malloc_or_die() from trace-cmd.c, but obviously we
are keeping the function of malloc_or_die() itself. Use a more descriptive
output when failing allocations.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Fail with a more descriptive message when failing to allocate.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Replace malloc_or_die() with a more descriptive exit when failing an
allocation.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The two places tha used malloc_or_die() already checked the return of the
call and failed appropriately if it did not succeed. No need to die.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If create_instance() fails to allocate an instance, it returns NULL. Have the
callers check the return of create_instance() to make sure it succeeded and
report if it failed.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Instead of calling just malloc_or_die() and having a generic output for what
happened on failure, die with a more appropriate message.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Have failed allocations specify more details to why it died than just doing
a malloc_or_die().
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Removed malloc_or_die from trace-cmd profile and have failed allocations
exit gracefuly.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When there's not enough memory for an allocation, return an error or warn
and handle it gracefully.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Make failure of memory allocations less extreme.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Exit nicely if malloc fails.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Handle failure of malloc nicer than just dieing.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Chaos Chen stated that he had a bug in his code; when the usecs overrun, and
1000000 needs to be subtracted from the usecs and added to the seconds, the
seconds need to be incremented not decremented.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
On x86, page_fault_* tracepoints report userspace address via kernel
symbols because all the per-cpu variable offsets are in kallsyms,
occupying the lower address space. Fix this by skipping over absolute
addresses while processing kallsyms.
Link: http://lkml.kernel.org/r/55BB8086.9080602@siemens.com
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Instead of using 1000000, define a USECS_PER_SEC macro and use that instead.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Sometimes we may see 1234.1000000 if time resolution in usec
Just fixing it from 1234.1000000 to 1235.000000
Signed-off-by: Chaos.Chen <rainboy1215@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
It was reported that "%-8s" does not parse well when used in the printk
format. The '-' is what is throwing it off. Allow that to be included.
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Had a bug where on error of parsing __print_array() where the
fields are freed after they were allocated, but since they were not
set to NULL, the freeing of the arg also tried to free the already
freed fields causing a double free.
Fix process_hex() while at it.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The sched_switch event had the same issue as the sched_wakeup event
in that the pid was used for lookups. Instead of having a separate
merge matching function, use the normal lookup function, but as we
do not care if the pid of the sched_switch or sched_wakeup events
are different, as long as we know that they all belong to the same
comm, we can ignore them. Just need to modify the search vals before
doing the lookups.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When profiling large applications that have multiple children we really want to
see the profile of the app all together. Add a --by-comm option to accomplish
this for profile. This merges all the events for like comms into one big chunk
so we can easily see what a giant app is doing, such as HHVM. Thanks,
Link: http://lkml.kernel.org/r/1432229408-1479-1-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
[ fixed up trace_hash ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Since kernel commit, 8e1e1df29d83 ("tracing: Add additional marks to
signal very large time deltas") the kernel annotates durations longer
than 1000 usecs with # and longer than 1 sec with $. Update trace-cmd
report to be consistent with it.
Link: http://lkml.kernel.org/r/05162f43fb6322f4c46722403449ffdab134e3d2.1435170824.git.osandov@fb.com
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Where such macro is not present, so just copy its definition from
glibc's endian.h and define it if not already.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-4j90i2na07ppidt0z6cbuxr7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Use %pS for actual addresses, otherwise you'll get bad output
on arches like ppc64 where %pF expects a function descriptor.
Link: http://lkml.kernel.org/r/1426130037-17956-22-git-send-email-scottwood@freescale.com
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
In my i386 build, it failed like this:
CC event-parse.o
event-parse.c: In function 'print_str_arg':
event-parse.c:3868:5: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 3 has type 'uint64_t' [-Wformat]
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Javi Merino <javi.merino@arm.com>
Link: http://lkml.kernel.org/r/20150424020218.GF1905@sejong
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Introduce an 'alias' field to 'struct format_field' to be able
to use alternative name for the field.
It is initialized with same string pointer as 'name' field.
The free logic checks the 'alias' pointer being reset by user
and frees it.
This will be handy when converting data into CTF, where each
field within event needs to have a unique name (while this
is not required for tracepoint). Converter can easily assign
unique name into the format_field struct.
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qwyq8blnfkg6s5vlbrvn1en3@git.kernel.org
Link: http://lkml.kernel.org/r/1429372220-6406-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Currently it ignores operator priority and just sets processed args as a
right operand. But it could result in priority inversion in case that
the right operand is also a operator arg and its priority is lower.
For example, following print format is from new kmem events.
"page=%p", REC->pfn != -1UL ? (((struct page *)(0xffffea0000000000UL)) + (REC->pfn)) : ((void *)0)
But this was treated as below:
REC->pfn != ((null - 1UL) ? ((struct page *)0xffffea0000000000UL + REC->pfn) : (void *) 0)
In this case, the right arg was '?' operator which has lower priority.
But it just sets the whole arg so making the output confusing - page was
always 0 or 1 since that's the result of logical operation.
With this patch, it can handle it properly like following:
((REC->pfn != (null - 1UL)) ? ((struct page *)0xffffea0000000000UL + REC->pfn) : (void *) 0)
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/1428298576-9785-10-git-send-email-namhyung@kernel.org
[ Replaced 'swap' with 'rotate' in a comment as requested by Steve and agreed by Namhyung ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Since 6ea22486ba46 ("tracing: Add array printing helper") trace can
generate traces with variable element size arrays. Add support to
parse them.
Signed-off-by: Javi Merino <javi.merino@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1427195239-15730-1-git-send-email-javi.merino@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The sequence of allocating the print_arg field, calling process_arg()
and verifying that the next event delimiter is repeated twice in
process_hex() and will also be used for process_int_array().
Factor it out to a function to avoid writing the same code again and
again.
Signed-off-by: Javi Merino <javi.merino@arm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1426875176-30244-2-git-send-email-javi.merino@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If the stats are showing with an instance with a name,
print the name (also add a separator between instances).
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When trace-cmd report --debug is set, show the internal ring buffer entries
like time-extends and padding. This requires adding new kbuffer API to
retrieve these items.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add --debug option to trace-cmd report that enables page boundary recording
as well as time stamp info to be printed.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If you recorded information completely in an instance then trace-hist wouldn't
think your trace.dat file had any events because it didn't know about instances.
Fix this.
Link: http://lkml.kernel.org/r/1431113344-22579-6-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Currently we just spit out the events as they appear in the hash, which makes it
hard to tell where we are spending our time. Instead order the output by type
and total time spent. So you'll get something like this
syscall 1: 100000ms
syscall 2: 80000ms
syscall 3: 4ms
func 1: 10ms
func 2: 1ms
instead of them all jumbled up.
Link: http://lkml.kernel.org/r/1431113344-22579-5-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add a test compile to make sure that libaudit is installed and define
NO_AUDIT if it is not. When that happens, a warning will occur in building
trace_profile() saying that it will use raw syscall numbers. Doing a
make NO_AUDIT=1, will surpress that warning.
Also fixed the NO_PTRACE to use "override" on changing of CFLAGS as
without it, it has no affect.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When we profile syscall times we're just given the syscall number, not the name.
This isn't helpful for human beings, so lookup the syscall names when we are
printing out the information. This uses the audit library to get this
information, I'm not married to it, but it seems that any app that does this
mapping has to scrape /usr/include/asm/unistd*.h to pull out the names, so might
as well just use somebody elses work.
Link: http://lkml.kernel.org/r/1431113344-22579-4-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
This allows tools linking against the trace-cmd libraries to supress this output
if it is not necessary for them.
Link: http://lkml.kernel.org/r/1411757220-29334-1-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
trace-cmd has a lot of built in warning() and pr_stat() output that is noisy
when you are using the python bindings. This patch provides overrides for these
two functions and the ability for python scripts to optionally turn them off.
With this patch I can silence all of these extraneous print messages from within
my python script.
Link: http://lkml.kernel.org/r/1411757074-29117-1-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The user_stack and kernel_stack events are special in that they are dynamic
arrays but aren't labeled as __data_loc like other dynamic arrays. This isn't a
big deal since they look the same, they have a "caller" field which is an array
of unsigned longs. This patch adds a helper to the python bindings to read
these arrays in, lookup the function and append them to a python list.
Link: http://lkml.kernel.org/r/1411667037-27105-1-git-send-email-jbacik@fb.com
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
I need to be able to just cycle through the events in a trace.dat file without
worrying about the CPU, so add read_next_event that mirrors the other
read_event* functions to call tracecmd_read_next_data.
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
trace-cmd split is an operation to make large data records into more
manageable sized files.
But for latency tracers like:
trace-cmd record wakeup
trace-cmd does not record any binary files, it only records the ASCII
contents of the trace file that is only a snapshot of where the latency
happens (which is usually rather small). trace-cmd split is made for
"flight recording" (constant recording over a period of time) that can
cause the file to become gigabytes in size. Splitting the ASCII text does
not make any sense.
That said, trace-cmd split should not segfault either when trying to split
a latency trace. Instead do what trace-cmd hist does, which is to simply
exit with an error message that says it does not support latency traces.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
As for extract, -a means all instances except the top one.
Use -t to get the top one too.
Link: http://lkml.kernel.org/r/d6cdd535ae170d4ba0f580434a51286861c75c07.1429677461.git.hcochran@kernelspring.com
Signed-off-by: Howard Cochran <hcochran@kernelspring.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
This option will extract all instances that currently exist in the
system, including the top instance. This differs from the meaning of -a
for record and stream (enable all events), which would have no purpose
for extract. Such difference in meaning already exists for -s, so this
seemed reasonable.
Had to fix a bug in create_instance(), in which it ignored its parameter.
Link: http://lkml.kernel.org/r/444ea8355d8c0013ec9d35155d4ea83ec1a7bbab.1429677461.git.hcochran@kernelspring.com
Signed-off-by: Howard Cochran <hcochran@kernelspring.com>
[ Fixed compile error to use different __add_all_instances() ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add -B option to trace-cmd extract so that it can extract listed
instances. As with start, stop, and reset, the top level instance is not
included when any -B are given. However, -t makes it also include the
top instance. As with other commands, if neither option is given, only
operate on the top instance.
Link: http://lkml.kernel.org/r/7b18a3f624fd1e864a86c0cee2079587953fa5ee.1429677461.git.hcochran@kernelspring.com
Signed-off-by: Howard Cochran <hcochran@kernelspring.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The fix to fix stop, restart, and start, broke them too for the default
instance. If -t or -B were not used, then -t is to be assumed, but
that was not the case, and no instance was selected.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If more than one -B is specified and -t is not, one of the instances
is skipped. Rewrite the code to process what list of buffers is needed
after the command line has been parsed.
Reported-by: Andy Martin from Lexmark, Inc.
[ Howard added checking if buffer_instance exists in update_first_instance() ]
Signed-off-by: Howard Cochran <hcochran@kernelspring.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Presenting trace-cmd at Linux Collaboration Summit, it was pointed
out to me that I had "bytes lost" in the new format as I was saying
it was events lost. Fix that.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Guilherme Cox found that:
There is, however, a potential bug if there is an item with code zero
that is not the first one in the symbol list, since eval_flag(..)
returns 0 when it doesn't find anything.
That is, if you have the following enums:
enum {
FOO_START = 0,
FOO_GO = 1,
FOO_END = 2
}
and then have:
__print_symbolic(foo, FOO_GO, "go", FOO_START, "start",
FOO_END, "end")
If none of the enums are known to pevent, then eval_flag() will return
zero, and it will match it to the first item in the list, which would
be FOO_GO, which is not zero.
Luckily, in most cases, the first element would be zero, and the parsing
would match out of sheer luck.
Reported-by: Guilherme Cox <cox@computer.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
SPC-3 defines SERVICE ACTION IN(12), SERVICE_ACTION OUT(12),
SERVICE ACTION OUT(16), and SERVICE ACTION BIDIRECTIONAL.
And READ MEDIA SERIAL NUMBER has long since been deprecated.
So update callers to refer to the new cdb name.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Tested-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
SPC-3 defines SERVICE ACTION IN(12) and SERVICE ACTION IN(16).
So rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 to be
consistent with SPC and to allow for better distinction.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Tested-by: Robert Elliott <elliott@hp.com>
Reviewed-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When a plugin option is defined, by default it is a boolean (true or false).
If the option is something else, then it needs to set its "value" field to
a default string other than NULL (can be just ""). If the value is not set
then the option is considered boolean, and the updating of the option value
will be handled accordingly.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The comment about PEVENT_PLUGIN_UNLOADER() was not updated when adding
the pevent as a parameter.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
So that we can specify a FILE object where to direct the formatted
output.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-a49bhdrx8851f04hppn8bqxq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Add a flag to pevent that will let the callers be able to set it and
keep the system, and perhaps even normal plugins from being loaded.
This is useful when plugins might hide certain information and seeing
the raw events shows what may be going on.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20140603032223.678098063@goodmis.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The traceevent plugins allows developers to have their events print out
information that is more advanced than what can be achieved by the
trace event format files.
As these plugins are used on the userspace side of the tracing tools, it
is only logical that the tools should be able to produce different types
of output for the events. The types of events still need to be defined by
the plugins thus we need a way to pass information from the tool to the
plugin to specify what type of information to be shown.
Not only does the information need to be passed by the tool to plugin, but
the plugin also requires a way to notify the tool of what options it can
provide.
This builds the plugin option infrastructure that is taken from trace-cmd
that is used to allow plugins to produce different output based on the
options specified by the tool.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20140603184154.0a4c031c@gandalf.local.home
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
[ ported to trace-cmd ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Move the calls that frees the resources allocated for a struct format_field to
a separate routine.
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1426790181-19118-1-git-send-email-dsahern@gmail.com
[ Split this part from a larger patch, added pevent_ prefix as requested by Steven ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The function tracecmd_create_buffer_recorder_pipe() is declared
but not implemented. For some reason some python versions want
to link it, even though it probably cannot be used in python
anyway, so this is causing issues.
Remove the unused declaration.
Reported-by: Gil Tribush <gil.tribush@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The function handler plugin uses "index" which could possibly be uninitialized
if the parent function is not found.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
The tlb_flush tracepoints uses enums that are not yet known by
trace-cmd. Add a plugin to handle that.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
If a wakeup event occurred when a task was not "asleep", which
could happen from dropped events, the wake up is ignored. But if
the proxy task does not have its last-event removed, and if a
stack trace occurs after the wakeup event, it will be hooked to
whatever was the proxy tasks's last event. This caused the output
to show spurious stack traces for various events (mostly the timer
softirq).
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
There was a bug when after a hook was read from the trace.dat file
it would be reset by the handle->hooks instead of assigning it to
the handle->hooks.
There was a second bug where the hooks in trace.dat file would
not be listed if there were no command line hooks presented.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
Instead of associating interrupts to tasks, when -G is used in
trace-cmd profile or trace-cmd report, the interrupts are set to
act as global events.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
When a custom hook is created, allow the global flag to work.
Implement the global tasks that can keep track of events where
tasks really have no meaning, and they can be called by any
task. This will work for timers.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
The output status is quite confusing. Seeing a blob like this:
CPU: 0
entries: 12
overrun: 0
commit overrun: 0
bytes: 3612
oldest event ts: 49097.376154
now ts: 49097.647663
dropped events: 0
read events: 147
Is pretty much useless for most people, and even confuses some (I get
confused by it sometimes).
Instead, cut it down to something much easier to read. We really only
care about overruns and commit overruns, but only if there are any.
Have it output like his instead:
CPU 2: 165358 bytes lost
Where it only shows us the CPUs that lost events.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|