aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* trace-cmd: Clean up trace-cmd usage outputSteven Rostedt2010-03-25
| | | | | | | | | | | | | | | | The usage just printed all commands and their full descriptions. This is too much for all the commands that trace-cmd does. This patch moves the usage out of trace-cmd.c and into a new file called trace-usage.c. It then makes a structure that holds the name of the command, a short description and the full usage (from the original usage). If no command, or the command passed to trace-cmd is not found, then the list of commands and their short usages are shown. If a command is passed in, only the usage for that command is shown. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Print field contents of failed parsed eventSteven Rostedt2010-03-25
| | | | | | | | | | | If an event fails to parse the print string, then it is better to show the contents as raw elements than just to print "FAILED TO PARSE" and drop the event. At least now the events show a bit more information, even if the print string did not parse correctly. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Fix field_is_string()Steven Rostedt2010-03-25
| | | | | | | | | | | | | | The field_is_string() function always returns true because it checks for !strstr(...), which returns 0 if it does not match. Thus the !strstr("char") || !strstr("u8") || !strstr("s8") One would fail and the entire code would end up being true. Also move the field_is_dynamic out of the field_is_string() condition because a field may be dynamic without being a string. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Fix dynamic flag settingSteven Rostedt2010-03-25
| | | | | | | | | | The dynamic flag was not being set because the compare in the field type was looking for an exact match of "__data_loc", when in reality, the field type also contained the array type as well (ie. "__data_loc int"). Just check the first 10 characters of the type. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* build: Have install print nicerSteven Rostedt2010-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the output of installing from: install -d -m 755 '/usr/local/share/trace-cmd/plugins' install plugin_hrtimer.so plugin_kmem.so plugin_sched_switch.so plugin_mac80211.so plugin_jbd2.so '/usr/local/share/trace-cmd/plugins' install -d -m 755 '/usr/local/bin' install trace-cmd '/usr/local/bin' gui build complete install -d -m 755 '/usr/local/bin' install trace-view '/usr/local/bin' install trace-graph '/usr/local/bin' install kernelshark '/usr/local/bin' to: INSTALL plugin_hrtimer.so to /usr/local/share/trace-cmd/plugins INSTALL plugin_kmem.so to /usr/local/share/trace-cmd/plugins INSTALL plugin_sched_switch.so to /usr/local/share/trace-cmd/plugins INSTALL plugin_mac80211.so to /usr/local/share/trace-cmd/plugins INSTALL plugin_jbd2.so to /usr/local/share/trace-cmd/plugins INSTALL trace-cmd to /usr/local/bin INSTALL trace-view to /usr/local/bin INSTALL trace-graph to /usr/local/bin INSTALL kernelshark to /usr/local/bin Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Print port on error using %s not %dSteven Rostedt2010-03-25
| | | | | | | On error to connecting to a machine, the port is printed with a %d. But the variable is of type char * and a %s should be used. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add BUILDING and INSTALL instructions to READMEJohn Kacur2010-03-25
| | | | | | | - Add BUILDING and INSTALL instructions to the README - Change Makefile so that messages don't appear like errors. Signed-off-by: John Kacur <jkacur@redhat.com>
* trace-cmd: Install plugins by defaultJohn Kacur2010-03-24
| | | | | | If you a user does "make install", also install plugins. Signed-off-by: John Kacur <jkacur@redhat.com>
* trace-cmd: Make the default value of prefix /usr/localJohn Kacur2010-03-24
| | | | | | | | Make the default value of prefix /usr/local which makes sense for most end-users Developers who wish to use $HOME can set this on the command line. (use ?= which only sets the default if prefix doesn't already have a value) Signed-off-by: John Kacur <jkacur@redhat.com>
* trace-cmd: Remove DESTDIR_SQ from the makefileJohn Kacur2010-03-24
| | | | | | | DESTDIR_SQ must have been incompletely copied from another project's makefile. It isn't serving a purpose here, so remove it. Signed-off-by: John Kacur <jkacur@redhat.com>
* trace-cmd: Add trace_plugin_dir to .gitignoreJohn Kacur2010-03-24
| | | | | | File trace_plugin_dir is generated during make. Add it to the .gitignore file. Signed-off-by: John Kacur <jkacur@redhat.com>
* parse-events: Add function to handler that is postponedSteven Rostedt2010-03-24
| | | | | | | | This was a silly bug that the function to add to events from plugins never was stored in the temp structure. Reported-by: "Luis Claudio R. Goncalves" <lclaudio@uudg.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* build: Fix plugin and install for O=output makesSteven Rostedt2010-03-23
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Let function handlers be overriddenSteven Rostedt2010-03-23
| | | | | | | | | Now that plugins are in both system and user directories, the user directory is processed after the system directory. This makes it highly likely that a function handler may be added again. Instead of warning about it and failing let the new function handler override the previous one. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* build/trace-cmd: Add way to install system default pluginsSteven Rostedt2010-03-23
| | | | | | | | | | If the prefix in the make build is not $(HOME) then a system wide plugin directory is used (in $(prefix)/share/trace-cmd/plugins). This is then compiled into the tracecmd library so that it knows to look for the plugins there. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Handle operations within a conditionSteven Rostedt2010-03-23
| | | | | | | | The conditon ? : does not handle other operations within it (like << which the ext4 tracepoints added). This patch makes the conditions handle operations within them. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add options to trace.dat fileSteven Rostedt2010-03-23
| | | | | | | | Add the start of option to the trace.dat file. This will allow later versions of the file to add data without breaking older versions of trace-cmd. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Added jbd2 pluginSteven Rostedt2010-03-23
| | | | | | | Added the jbd2 plugin that adds the helper functions to handle jbd2_dev_to_name() and jiffies_to_msecs(). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add hook for plugins to register function handlingSteven Rostedt2010-03-23
| | | | | | | | | | | Sometimes an event may use a helper function inside the print format. Unfortunately, parse-events does not know how to handle these. This patch adds a registration function pevent_register_print_function() That a plugin can use to register how to handle helper functions in the event's print format. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Handle failure of process opSteven Rostedt2010-03-23
| | | | | | | | | | If the process_op fails in event_read_print_args the failure will go unnoticed. Also do zero out the right arg on failed condition, since it may point back to the original arg and cause a double free. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Fix freeing of failed condition (part 2)Steven Rostedt2010-03-22
| | | | | | | The *tok is already set to NULL, the token variable is allocated. We need to free that instead of *tok. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Fix freeing of failed conditionSteven Rostedt2010-03-22
| | | | | | | | If the condition processing fails, we free right and left args but they are already assigned to the main arg so that it would be freed again when the main arg is freed. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Move the printing of the mac address into its own functionSteven Rostedt2010-03-19
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-event: Test for field type in print format "%pM"Steven Rostedt2010-03-19
| | | | | | | | | | The processing of the "%pM" just assumes that the print_arg is of field type. This may not be the case and if it is not, then it will have unpredictable results. Test to make sure the field type is what is expected. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Only show plugins that are loaded when -V is usedSteven Rostedt2010-03-19
| | | | | | | The output of the plugins being loaded, while useful, are quite annoying. Make it default off and add an option to display them. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add -h to to show help without a commandSteven Rostedt2010-03-19
| | | | | | | | | | trace-cmd -h or trace-cmd help both show an error with the arguments. This patch fixes this to just display the help message. Report-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Documentation - various spelling fixes.John Kacur2010-03-19
| | | | | Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: add TAGS and tags to .gitignore.John Kacur2010-03-19
| | | | | Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* build: Makefile, add ctags for (g)vimJohn Kacur2010-03-19
| | | | | | | | | Add the ability to make tags for (g)vim. Also, add a section in clean that removes TAGS and tags Signed-off-by: John Kacur <jkacur@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* build: Add support for building out of tree with O=/object/output/dirSteven Rostedt2010-03-19
| | | | | | | | | | | | Some people prefer to have the build output be done out of tree. This follows the Linux method of building the objects in another path. make O=~/mypath Will build the objects and the executables into the ~/mypath directory. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* build: Add install for executablesSteven Rostedt2010-03-10
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Register plugins before reading eventsSteven Rostedt2010-03-10
| | | | | | | | Register plugins before events are read. This will remove warnings about events that can not be parsed event though a plugin will read that event anyway. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Change printf to pr_stat() in registering pluginsSteven Rostedt2010-03-10
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Let plugins be registered before reading eventsSteven Rostedt2010-03-10
| | | | | | | | Allow a plugin to be registered before reading events. This will enable plugins to be registered, and then not warn about events that do not parse, if a plugin is registered for that event. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Have -q also remove printing overrinding event outputsSteven Rostedt2010-03-10
| | | | | | | Make the -q option of trace-cmd report silence the outputs of overriding event callbacks. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-event: Add pr_stat()Steven Rostedt2010-03-09
| | | | | | | Added a pr_stat() function to print out status that can also be used by applications to override it. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add '-q' to trace-cmd report to silence warningsSteven Rostedt2010-03-09
| | | | | | | Added a -q option to trace-cmd report that will not print out warnings about parsing errors. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add Makefile to build man pagesSteven Rostedt2010-03-08
| | | | | | | | | | | Add a Makefile that has logic to build a man page. It is still very primitive and uses ascriidoc and xsltproc to do the formating. But instead of build my own xsl file or putting together one from others, I decided to use xsl files that already exist by doing a locate on manpages/docbook.xsl, and using what is found. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add documentation that will become manpages for trace-cmdSteven Rostedt2010-03-05
| | | | | | Added a Documentation directory that will become the trace-cmd manpages. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-view: Keep selected row after CPU filtersSteven Rostedt2010-03-04
| | | | | | | | | | | After a CPU filtering event happened, the selected row was lost and the first row is selected. This gets annoying when you have a row selected and want to filter out the other CPUs. You would lose the row and then have to search for it again. This patch reselects the selected row after a CPU filter change. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Don't crash on printk format errorsSteven Rostedt2010-03-03
| | | | | | | | For some reason the trace-cmd split caused the printk format to have lonely ":" on the line which caused the parsing to break. Just warn instead of crashing. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-record: Fix bug with using wrong file descriptorJiri Olsa2010-02-25
| | | | | | | | | tracecmd_create_recorder opens with fd, but then incorrectly checks recorder->fd. Signed-off-by: Jiri Olsa <jolsa@redhat.com> LKML-Reference: <1267119647-16775-1-git-send-email-jolsa@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add -b option to change ring buffer sizeSteven Rostedt2010-02-25
| | | | | | | Add the -b option to record and reset to allow the user to modify the ftrace ring buffer size in kilobytes per CPU. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add -t to force use of TCP for live connectionSteven Rostedt2010-02-24
| | | | | | | | | Add the option -t for use with -N on record, to force the use of TCP instead of UDP in recording the trace output. This makes the connection more reliable at the cost of performance and noise in the trace. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Do not bail on failing mmap on second CPU if first had no sizeSteven Rostedt2010-02-24
| | | | | | | | | | | | If the first CPU had no size, and the second CPU failed to mmap, do not fail the entire trace-cmd report. The mmap check is not done on CPUs with no size. If the mmap fails, then check the previous CPUs to see if any of them had size, and if so then bail. But if none did, then continue. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Fix accept in listen for tcp client readSteven Rostedt2010-02-24
| | | | | | | | | | | The peer_addr_len was not being initialized for use with accept in the TCP version of the client read. This caused the accept to fail. Also added error checks and printing of the fact that the client requested using TCP. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Use TCP if page size is too big for UDPSteven Rostedt2010-02-24
| | | | | | | | | If the kernel page size is too big (as it can be with PPC and other archs), we switch to using TCP for the live reads. This may impact performance, but still lets the code work. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Fix endian bug in get_str()Steven Rostedt2010-02-24
| | | | | | | | The get_str() code was missing an endian conversion. Also the macros for data2hast needed parenthesis. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Stop recording if the recorder failsSteven Rostedt2010-02-24
| | | | | | | Add a check to the recorder to see if it failed. If it did, stop processing. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Remove some dead code from trace-listen.cSteven Rostedt2010-02-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>