aboutsummaryrefslogtreecommitdiffstats
path: root/parse-events.h
Commit message (Collapse)AuthorAge
* rt-graph: real-time plots display info popupJonathan2012-03-06
| | | | | When you hover close enough to an events time, the event name will display. This time is based on _litmus_ time, not record time.
* rt-graph: real-time plots now draw other eventsJonathan2012-03-06
| | | | | Vertical lines mark events which were run either with the tasks pid or ran on the task's cpu while it is executing.
* parse-events: Modify header to work in C++ programsSteven Rostedt2011-10-17
| | | | | | | Replace keywords "private" and "bool" from parse-events.h to allow it to be used in C++ programs. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add parse error checking targetVaibhav Nagarnaik2011-07-29
| | | | | | | | | | | | | | Add another target 'check-events' which parses all the event formats and returns whether there are any issues with the print format strings. With an error in the format, the return value is 22 (EINVAL) and for success, it is 0. Cc: Michael Rubin <mrubin@google.com> Cc: David Sharp <dhsharp@google.com> Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com> Link: http://lkml.kernel.org/r/1311619188-4905-1-git-send-email-vnagarnaik@google.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Fix address of the Free Software FoundationUwe Kleine-König2011-03-22
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: fold meSteven Rostedt2011-03-18
|
* parse-events: Add names for plugin optionsSteven Rostedt2011-03-18
| | | | | | | Add PEVENT_PLUGIN_ALIAS and PEVENT_PLUGIN_OPTIONS for plugins to use. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add debugging to find where leaked records areSteven Rostedt2011-02-21
| | | | | | | | Add DEBUG_RECORD macro that records the address of the caller to get a record, and if there are leaked records existing, print out where the extra records were allocated from. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-event: Add way to just test a filter stringSteven Rostedt2011-01-21
| | | | | | | If pevent->test_filters is set when a filter string is added, then it will print the filters strings that were created and exit. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Rewrite filter algorithm to simplify itSteven Rostedt2011-01-21
| | | | | | | New rewrite of the parse event filter to greatly simplify the logic. Should be much easier to modify it now. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Show where error occurred in filteringSteven Rostedt2011-01-20
| | | | | | | | | | | | | | | Show a nice pointer where an error occurred in filtering: # trace-cmd report -F 'sched_switch:(next_pid==x)||)prev_pid == 1' version = 6 cpus=4 trace-cmd: No such file or directory Error filtering: sched_switch:(next_pid==x)||)prev_pid == 1 (next_pid==x)||)prev_pid == 1 ^ Expected end where ) was found Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Always allocate comm for pevent_register_comm()Steven Rostedt2011-01-19
| | | | | | | | | | | The function pevent_register_comm() will allocate its own comm depending on when you execute it. This is stupid and likely to cause bugs. Make it always allocate its own comm and also change the parameter name to accept const char *. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Add struct filter_arg_expLai Jiangshan2011-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | Use "struct filter_arg_exp" instead of "struct filter_arg_op" for FILTER_ARG_EXP and eliminate the warnings: /home/laijs/work/trace-cmd/parse-filter.c: In function ‘get_exp_value’: /home/laijs/work/trace-cmd/parse-filter.c:1461:2: warning: case value ‘4’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1464:2: warning: case value ‘5’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1467:2: warning: case value ‘6’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1470:2: warning: case value ‘7’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1473:2: warning: case value ‘8’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1476:2: warning: case value ‘9’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1479:2: warning: case value ‘10’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1482:2: warning: case value ‘11’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c: In function ‘exp_to_str’: /home/laijs/work/trace-cmd/parse-filter.c:1844:2: warning: case value ‘4’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1847:2: warning: case value ‘5’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1850:2: warning: case value ‘6’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1853:2: warning: case value ‘7’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1856:2: warning: case value ‘8’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1859:2: warning: case value ‘9’ not in enumerated type ‘enum filter_op_type’ /home/laijs/work/trace-cmd/parse-filter.c:1862:2: warning: case value ‘10’ not in enumerated type ‘enum filter_op_type’ Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add PRINT_BPRINTK to separate bprintk strings from dynamicSteven Rostedt2010-11-16
| | | | | | | | | | | 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>
* parse-events: Make trace_seq dynamically expand its buffersSteven Rostedt2010-09-03
| | | | | | | | | | | | | | | | | | | | 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>
* parse-events: Add pevent_get_field_raw()Steven Rostedt2010-09-02
| | | | | | | | | 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>
* parse-events: Add helper functions pevent_get_field_val()Steven Rostedt2010-06-17
| | | | | | | | Several plugins were implementing their own helper function to set a value of the data from a field. Move the helper function into the core code. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add helper function pevent_print_num_field()Steven Rostedt2010-06-17
| | | | | | | | | | | The _print_field() and print_field() functions were being used by multiple plugins. Each implementing their own helper function to get a field and print its value. Instead of having multiple functions to do the same job in different plugins, just add it to the core code. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd/kernelshark/parse-events: Add const char to output functionsSteven Rostedt2010-06-11
| | | | | | Add const char *fmt to die, warning and pr_stat. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add vpr_stat()Steven Rostedt2010-06-11
| | | | | | | Add a vpr_stat(const char *fmt, va_list ap) that can be overridden. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Make char parameters const in pevent_parse_event()Steven Rostedt2010-06-11
| | | | | | | The pevent_parse_event() function does not modify the parameters @buf or @sys. They should be made constant. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Merge branch 'kernelshark-devel' into trace-cmdSteven Rostedt2010-06-10
|\ | | | | | | | | | | | | Conflicts: Makefile Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * kernelshark/parse-events: Add tests if event filters are sameSteven Rostedt2010-06-10
| | | | | | | | | | | | | | | | | | | | On load of event filters, if the list and graph filters are the same, then make them synced. On syncing of event filters, if they are already the same, do not ask which way to sync, just sync them and keep them synced. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| * parse-events: Move parse-event utils to separate fileSteven Rostedt2010-04-09
| | | | | | | | | | | | | | | | Move the util functions used by parse-events into a separate file and compile it with the libparsevents library. Also add "__die()" equivalent functions that are always available. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* | trace-cmd: Add back locked recordSteven Rostedt2010-06-08
| | | | | | | | | | | | | | | | To debug when a record is being freed and still referenced internally, the "locked" field is added. This will flag when a record has been freed when it should not have been. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* | Merge branch 'python2' of http://git.sipsolutions.net/trace-cmd into trace-cmdSteven Rostedt2010-05-25
|\ \
| * | trace-cmd: make records refcountedJohannes Berg2010-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a callback wants to hold on to a record, it can then increase the refcount and keep it. This is most likely to happen with the upcoming python plugin. Since the underlying data pages are already refcounted, we can just add a refcount to struct record (rather than having the error checking with the 'locked' member). Acked-by: Darren Hart <dvhltc@us.ibm.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
* | | parse-events: Fix unaligned accesses while fetching trace valuesFrederic Weisbecker2010-05-24
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accessing trace values of an 8 size may end up in a segfault on archs that can't deal with misaligned access, which is the case for sparc 64. This is because PERF_SAMPLE_RAW are aligned to 4 and not to 8. Fix this on the macros that get the values of 8 size. This fixes segfaults on perf tools in sparc 64. [ Got permission from Frederic to include this for LGPL trace-cmd ] Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1274348659-15417-4-git-send-regression-fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Masami Hiramatsu <mhiramat@redhat.com> Cc: David Miller <davem@davemloft.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* | parse-events: Pass context to callbacksJohannes Berg2010-05-17
| | | | | | | | | | | | | | | | | | | | | | For the upcoming python plugin, it will be required to pass a context into the callback function so that it can use a single C function to handle everything. Acked-by: Darren Hart <dvhltc@us.ibm.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* | trace-cmd: Correctly handle arraysIan Munsie2010-05-14
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Taken from a perf patch. I got the OK from Ian Musie to include this under LGPL ] Previously, perf was assuming that an array from an ftrace event was an array of longs, which will not always be the case. Additionally, long_size is not even being initialised, so it would fail to read the data and would erroneously report that the array was filled with zeroes. This patch adds two extra entries into the field structure - arraylen and elementsize, so that the code can easily look them up instead of assuming that the elements are long_size. The element size is currently derived by the size of the entire array and the number of elements within the array. This problem can be demonstrated with: perf record -e raw_syscalls:sys_enter -a sleep 0.1 perf trace Without this patch, output similar to the following is produced: perf-4355 [004] 1871.504685: sys_enter: NR 319 (0, 0, 0, 0, 0, 0) perf-4355 [004] 1871.504723: sys_enter: NR 3 (0, 0, 0, 0, 0, 0) perf-4355 [004] 1871.504733: sys_enter: NR 204 (0, 0, 0, 0, 0, 0) After applying this patch, the output looks like: perf-4355 [004] 1871.504685: sys_enter: NR 319 (10247ac0, ffffffff, 5, ffffffff, 0, 107a80d8) perf-4355 [004] 1871.504723: sys_enter: NR 3 (a, ffb6fcf0, 20, ffffffff, 0, 10112c20) perf-4355 [004] 1871.504733: sys_enter: NR 204 (a, 4, 800, 6, 0, 10112c20) Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> LKML-Reference: <1273730632-21008-3-git-send-email-imunsie@au1.ibm.com> [ Fixed array handling ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Fix parenthesis parsing of filtersSteven Rostedt2010-04-01
| | | | | | | | | | | | | The parenthesis filter parsing was a bit broken and needed a rewrite. This redesigns the filter parsing to be a bit more sane when it comes to parenthesis. It lets the parenthesis be treated as what they resolve to be. Funny, the example used by kernelshark failed because of this bug: "next_prio < 100 && (prev_prio > 100 && prev_pid != 0)" Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* trace-cmd: Show lost events if buffer supports itSteven Rostedt2010-04-01
| | | | | | | | | | | If the ring buffer in the kernel sends information via the commit field of the sub buffer header. Than this patch will display where events were lost. If the sub buffer has space and can store the count of dropped events, this patch will show the count as well. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Print raw fields of type long in hexSteven Rostedt2010-03-25
| | | | | | | | When raw fields are printing, check if the field is of type long. Since longs usually store pointers, it makes more sense to print out a hex number for a field declared as long than decimal. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add raw format for printing eventsSteven Rostedt2010-03-25
| | | | | | | | | | | | | | | | | Add print_raw field to pevent that will cause the pretty_print function to output the entries by their raw data in the fields, and will ignore the print formats. When set, each field will show its data. So instead of this: sched_switch: task swapper:0 [140] (R) ==> trace-cmd:31807 [140] We have: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=140 prev_state=0 next_comm=trace-cmd next_pid=31807 next_prio=140 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: 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>
* 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>
* 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>
* parse-events: Restructure advanced filter to handle arithmeticSteven Rostedt2010-02-22
| | | | | | | | | | | | | | | Have fields be compared to each other and have mathmatic algorithms applied. Now we can do: funcgraph_exit : rettime - calltime > 1000000 Or sched_wakeup : pid == common_pid Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_event_common_fields() and pevent_event_fields()Steven Rostedt2010-02-19
| | | | | | | | Add the functions pevent_event_common_fields() and pevent_event_fields() that return an allocated array of the events common or event specific fields. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Cache last event foundSteven Rostedt2010-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | Code commonly passes around the event id and uses that to find the event. Even if the event was already found, it uses the id to find it later. By caching the last event found by the name or id, and checking that on the next query before searching, saves some time. Running trace-cmd report on 6,000,000 events went from: real 0m41.805s user 0m39.483s sys 0m2.311s to: real 0m39.769s user 0m37.401s sys 0m2.356s About a 4% speed-up. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_update_trivial()Steven Rostedt2010-02-17
| | | | | | | Add pevent_update_trivial() to use one filter to update the another filter. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_filter_copy()Steven Rostedt2010-02-17
| | | | | | Add pevent_filter_copy() to be able to copy one filter onto another. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_filter_event_has_trivial()Steven Rostedt2010-02-17
| | | | | | | Add pevent_filter_event_has_trivial() to test if an event has a trivial TRUE, FALSE, or either filter. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_filter_clear_trivial()Steven Rostedt2010-02-17
| | | | | | | Add the function pevent_filter_clear_trivial() to be able to remove just those filters that are TRUE or FALSE (or both). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add parse_filter_remove_event() prototype to headerSteven Rostedt2010-02-17
| | | | | | Forgot to add parse_filter_remove_event() to parse_events.h Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_filter_make_string()Steven Rostedt2010-02-17
| | | | | | | | Add the function pevent_filter_make_string() that will return an allocated string that translates a filter of an event. This can be used to display the defined filters back to the user. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add regex to string matches for filterSteven Rostedt2010-02-16
| | | | | | | | | | Add =~ and !~ for filtering string matches. Also fixed the == and != string matching since it was using strncmp() due to values may not being NULL terminated. Copies the data instead and compares the copy. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_filter_reset()Steven Rostedt2010-02-16
| | | | | | | Add function pevent_filter_reset() to reset and clear all filters in an event_filter structure. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* parse-events: Add pevent_event_filtered()Steven Rostedt2010-02-16
| | | | | | | Add filter function pevent_event_filtered() to return true if the event has a filter against it, and false otherwise. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>