| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
|
|
|
| |
When bprintk had a "%s",string format, the args for the bprintk used
a dynamic string arg for the string. Unfortunately, this would cause
the string to not be found and nothing would be printed.
This patch adds a special PRINT_BPRINTK type that lets the processing
do something special with the bprintk strings.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
| |
Add tracecmd_add_option that allows us to add options into the
trace.dat file. Currently, options may only be added before
the file has been written.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code to reset the cpu to a specific timestamp some time fails
if the time stamp does not match the current saved time stamp
and we go to another page. Without resetting the timestamp
for that page, the algorithm can get confused if the timestamp
is currently in the middle of the page and the record we
want is on the page but before the timestamp.
Simply reset the timestamp to the start of the page when
going to another page.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
|
|
| |
Allows dynamic specification of the plugin directory so that plugins can be
used when the install prefix cannot be predicted, such as when using a
pre-compiled version of trace-cmd with Autotest.
Signed-off-by: David Sharp <dhsharp@google.com>
LKML-Reference: <1285718416-1470-1-git-send-email-dhsharp@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
|
|
|
| |
As the SIGUSR1 handler is so far registered after forking the recorder
child, there is a small race window where a flush sent by the main
process can actually kill the child. Plug this by registering the signal
handlers before the fork. This also allows to unify SIGINT registration.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
LKML-Reference: <4CB8401B.2020801@siemens.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
| |
tracecmd report --cpu # will segfault if # is greater than the
last CPU defined in the trace.dat file. Prevent tracecmd_peek_data()
from reading past the last CPU.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
| |
%0xlx is not a valid printf format.
Signed-off-by: Avi Kivity <avi@redhat.com>
LKML-Reference: <1286787515-13722-1-git-send-email-avi@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
| |
'guest_rip' is not part of kvm_emulate_insn.
Signed-off-by: Avi Kivity <avi@redhat.com>
LKML-Reference: <1285493922-29797-1-git-send-email-avi@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On some systems, the code to find a unique udp port may
give a invalid success of the previous port. Which causes two
child process to listen to the same port, and makes one of them
fail.
Force the start of the port search to the port after the last
port found, to prevent the same port from being used by two
listeners.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
| |
Add the stack command to the trace-cmd man page.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
| |
Added the command "trace-cmd stack" to run the stack tracer.
It simply enables the stack tracer and depending on the options
it will ouput the current stack, or disable it.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|
|
|
|
|
|
|
|
|
| |
Override kvm_emulate_insn formatting to use a disassembler to format
the emulated instruction. If a disassembler (udis86) is not available,
fall back to showing the instruction bytes in hex.
Signed-off-by: Avi Kivity <avi@redhat.com>
LKML-Reference: <1284906837-2431-1-git-send-email-avi@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
Makefile
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added code to handle the kvm events that happened whil doing a trace
on a 2.6.34 version of the kernel on my Intel box.
This adds a kvm plugin to process some of the kvm events.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Use the POSIX sysconf instead of the hack to figure out the number of
CPUs the current machine has.
Suggested-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
The CPU color for task plots is a bit close at the lower end. Add
some salt to the algorithm to spread it out a bit more.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
The plot of a task, we already know what task it is. It would be nice
to know what CPU a task is on at a given location.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently when you zoom into a task plot, when there are no events in
the viewable area, the line turns blank (as if it were just idle).
This patch keeps the plot with a bar even if no events are visible.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently when you zoom into a CPU plot, when there are no events in
the viewable area, the line turns blank (as if it were just idle).
This patch keeps the plot with a bar even if no events are visible.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, if a zoomed view has events before the start of the view,
those events are not examined to determine if the bar of a graph should
be shown at the start.
This patch adds code to the cpu and task plots to look for events
that happened before the view to determine if a bar should be shown
or not.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Add tracecmd_record_ref() to let an application up the reference
to a record to be used at a later moment. This makes sure the record
is not freed by the calling function.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The restore feature now allows you to make a trace.dat file from
several trace.dat.cpu.X files. This will let you put together files
leftover from a crashed trace-cmd record run.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
The tracecmd_create_init() function never used the cpus variable
that was passed in. It is not needed, thus it is removed.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
lseek64 returns 64-bit, but was being truncated to int. Large offsets would
cause the subsequent error checking to fail spuriously, leaving behind a bad
trace.dat and a collection of trace.dat.cpuX files.
Signed-off-by: David Sharp <dhsharp@google.com>
LKML-Reference: <1284411266-30442-1-git-send-email-dhsharp@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit e892161f731e958980fa977e2d7980f3cf0819ce changed trace_seq to
dynamically expand its buffer. In two instances the destroy function
was called too early, causing a freed s.buffer to be used.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
LKML-Reference: <1283684704-5650-1-git-send-email-stefanha@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
The dynamic_array parsing left out a necessary free_token().
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The trace_seq code that is used to copy data into a buffer to later
be able to print was originally taken from the Linux kernel. But the
constraints on the kernel are different than what they are in userspace.
Since the kernel uses the trace_seq in critical paths, it can not
allocate memory during use, so it used a static page buffer.
But in userspace, we do not have this constraint, and are allowed to
realloc the buffer when needed. There's no reason to fill the buffer
when we hit the buffer size, we can simply allocate more memory.
The downside to this is that we must call a destructor on the trace_seq
structure. All trace_seq's must be initialized with trace_seq_init(),
so this patch matched all trace_seq_init()'s with the new function
trace_seq_destroy().
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add new function pevent_get_field_raw that returns a pointer to
the actual data and also returns the size.
This is makes handling arrays convenient in plugins.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, we can only filter the report on one CPU or all CPUS.
This patch allows users to add a range:
trace-cmd report --cpu 1-5
trace-cmd report --cpu 1,3,6
trace-cmd report --cpu 1,2-4,6,9
trace-cmd report --cpu 1 --cpu 2 --cpu 5,6 --cpu 9-12
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
print fmt: "page=%p pfn=%lu order=%d migratetype=%d", REC->page, ({ struct page *__pg = (REC->page); int __sec = page_to_section(__pg); (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); }), REC->order, REC->migratetype
This cannot be parsed, leading to a NULL struct event_format* being
passed to pevent_get_common_field_val, which produces a SIGSEGV. It
would be good to get a parsable format from the kernel, but to
remediate the problem for legacy kernels, we can just return an error
indicator in this case. This allows some output from trace-cmd
report, although perhaps with some missing data. But this is better
than crashing.
(v2): Do the check in all pevent_get_*
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
LKML-Reference: <1279832705-14219-1-git-send-email-ddaney@caviumnetworks.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This 'fixes' another crash I encountered. Don't try to dereference
NULL records.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
LKML-Reference: <1279586810-29859-3-git-send-email-ddaney@caviumnetworks.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Under some circumstances, I'm not sure exactly which, a trace.dat file
may contain a bunch of zeros at the end of one or more of the trace
logs. This can lead to tracecmd_peek_data() attempting to read past
the end of the mmaped log, causing SIGSEGV.
This is a two part fix.
1) For 'new format' data, we always try to read 8 bytes of data. Make
sure that they are all on the current page.
2) In pevent_print_event(), if record->size is negative, warn and then
skip attempting to print it.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
LKML-Reference: <1279586810-29859-2-git-send-email-ddaney@caviumnetworks.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The gtk_menu_item_get_label() function was implemented in gtk 2.16.
This adds the compat function for building kernelshark against
gtk earlier than 2.16.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The finfo structure to represent ftrace events did not initialize
the tracecmd input handler. When tracing the stacktrace event, it
would cause a SEGFAULT.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The function graph needs to store the function graph return event
for later use. This patch changes the function graph callbacks
to use the context to store this information and initialize it
when first referenced.
The event data is now stored on the tracecmd_input handle, that allows
more than one tracecmd_input handle to work with this code in one
utility.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The bprint processing of %d was the same as %ld, which would cause
it to read 8 bytes instead of 4 bytes on a 64 bit box. This would
cause the other parameters after it to be shifted by 4 bytes and
produce garbage results.
Reported-by: Darren Hart <dvhltc@us.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| | |
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, if 'trace-cmd start' passes an event that is not found
it will cause the command to fail.
This can be a problem for an administrator using trace-cmd on several
machines that have different modules configured in. One script may
be used that has all the events to be traced, but some of the events
may not exist on all machines. This means each machine will need
its own separate script.
Instead of having a separate script, add a '-i' option that lets one
ignore failed events.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
LKML-Reference: <20100629144832.38C6.A69D9226@jp.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
For vi, add tags for file names, function prototypes and external and
forward variable declarations.
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Seems that unloading the dynamic plugin and loading it again
does not reset the static variables back to their original
value.
On unload, reset these variables back.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a plugin_function.so that will override the function tracer
and use the parent functions to determine how to indent
a function. This give a nice visual affect similar to what
the function graph tracer provides.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Load the ftrace function print handlers before loading the plugins.
This allows for a loaded plugin to override one of the ftrace default
output functions.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Have the shark_info save the captured output as well as the max
buffer size, and have those persistent when closing and
opening the capture dialog.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
Let the user change the size of the max output size from a
capture.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
If the event_comm_field has not been set (does not exist)
then we must also set comm to NULL so that later in the
function, it does not reference the comm variable.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Only allow one meg to be displayed at a time in the output
display of the capture window. Otherwise, it can fill up
too much and waste a lot of memory.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
"Cancel" is confusing and people may think that the Cancel will
just stop the trace and do nothing more. But this is incorrect.
The cancel button will stop the trace and update the data for the
graph and list.
Changing it to "Close" shows that it just closes the window.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
Instead of popping up another dialog to stop the run, have
the "Run" button simply change to "Stop". This makes it a lot nicer.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
The ftrace_comm_field may not be set. Do not use it if
it has not been initialized.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|
| |
| |
| |
| |
| |
| |
| | |
Make the capture output display bigger and have only
it expand when the dialog expands.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
|