aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* Let plugins get access to the function mapSteven Rostedt2009-11-24
| | | | | | | | | | Added: const char *pevent_find_function(unsigned long long addr) This will find the function name that maps to the address addr. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Allow for reading of the format fields of an event by a pluginSteven Rostedt2009-11-24
| | | | | | | | | Plugins need to find information about the format fields like the offset and size of the field. Added: pevent_find_field(event, name) Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Add event handle to plugin print callbackSteven Rostedt2009-11-24
| | | | | | | | The plugin should have the ability to look at information in the event (like offsets and sizes of fields). To do this we need to pass the event handle to the callback. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Change test plugin to override hrtimer events start and expire_entrySteven Rostedt2009-11-24
| | | | | | | The hrtimer events hrtimer_start and hrtimer_expire_entry currently fail to parse. Override these events to show better data. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Move copying of system name higher in event initializationSteven Rostedt2009-11-24
| | | | | | | Even events that fail should still have a system name. Otherwise referencing an event without it will segfault. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Move the failed to parse message to the pretty print callerSteven Rostedt2009-11-24
| | | | | | | | | | In case an event fails to parse, but it has an override handler, we want to make sure that handler gets called for it. The pretty print functions should fail if the event failed to parse but not the printing of the event itself. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Report plugin activitySteven Rostedt2009-11-24
| | | | | | | | | Add prints when a plugin is added, as well as when it overrides a format. This will prevent people wondering why the output of some event is not what they expect, when they forget that they have a plugin installed. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* allow plugins to override the event parsing handlerSteven Rostedt2009-11-24
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds the function to parse_events called pevent_register_event_handler(int id, char *sys_name, char *event_name, pevent_event_handler_func func) If id is >= 0 then the event is searched for by id, and checked against sys_name and event_name if those are non NULL. If id < 0, then the sys_name and event_name are used. If sys_name is non NULL, it will match the event system with that name, otherwise it will just find the first event named event_name. The pevent_event_handler_func is defined as: int (*func)(struct trace_seq *s, void *data, int size); This lets a plugin register a function that will be called in place of the "pretty_print" function for the event. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Add method to load plugins at trace-cmd report timeSteven Rostedt2009-11-24
| | | | | | | | | | | | | | | | | | | | | | | This adds a method to load a plugin. It looks in the users directory ~/.trace-cmd/plugins and tries to load any file there. To create a plugin simply make a C file that has this minimum format: #include "parse-events.h" int PEVENT_PLUGIN_LOADER(void) { ... } Then compile it with the following method: gcc -c plugin.c -fPIC -o plugin.o gcc -shared -nostartfiles -o plugin Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Added trace-cmd.hSteven Rostedt2009-11-24
| | | | | | Move trace-cmd specific items from parse-event.h to new trace-cmd.h. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Rename parse_event_file to pevent_parse_event and remove parse_ftrace_fileSteven Rostedt2009-11-24
| | | | | | Remove all users of parse_ftrace_file, and now use pevent_parse_event(). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Merge parse_ftrace_file() into prase_event_file()Steven Rostedt2009-11-24
| | | | | | | With the new ftrace format, the parse_ftrace_file function is almost identical to the parse_event_file. Merge the two. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Rename print_event to pevent_print_eventSteven Rostedt2009-11-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Make trace_find_event staticSteven Rostedt2009-11-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Change process_arg_token to staticSteven Rostedt2009-11-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Rename print_printk to pevent_print_printkSteven Rostedt2009-11-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Separate out the printk formats from the librarySteven Rostedt2009-11-24
| | | | | | | | | | | The mappings for the printk format strings and their addresses may be done differently by different utilities. This separates out the mapping of printk formats with their in kernel addresses. It also adds the function: pevent_register_print_string Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Rename print_funcs to pevent_print_funcsSteven Rostedt2009-11-24
| | | | | | All global functions in libparsevent must have pevent_ as a prefix. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Separate out function parsing from librarySteven Rostedt2009-11-24
| | | | | | | | | | The mapping of addresses to their functions is separated out from the library. The reading of the data belongs to the application, but we add a way to register a mapping between function and address with pevert_register_function Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Separate out comm registry from app and librarySteven Rostedt2009-11-24
| | | | | | | | | | | | The way the comm and pids are associated may be different with different apps. Let the app decide how it will register a mapping of comm and pid. Created trace-util.c file to hold the app side of comms. Create pevent_register_comm to implement the library register routine. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Use a static library instead of a dynamic oneSteven Rostedt2009-11-24
| | | | | | | | A dynamic library will cause pain to users when they find that the tool can not find the library. For now, just use a static library to make the use of the tool more convenient. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Make trace-seq part of the libparsevent librarySteven Rostedt2009-11-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Move trace-seq header into parse-events.hSteven Rostedt2009-11-24
| | | | | | | The functions for trace-seq are moving into the parse-events library. We need to keep the headers more consolidated. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Remove unused functions from trace-seqSteven Rostedt2009-11-24
| | | | | | trace_seq_putmem* and trace_seq_reserve are not used by the parser. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Convert parse-event.h file into a librarySteven Rostedt2009-11-24
| | | | | | | | This is the first step in making a shared library for other applications to use the parse-event functions for parsing the TRACE_EVENT from raw data. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Implement typecasting in parserSteven Rostedt2009-11-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Handle typcasts in '[' operatorSteven Rostedt2009-11-24
| | | | Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Free correct argSteven Rostedt2009-11-24
| | | | | | | After copying the contents of the left arg into arg, free the left arg, not the arg itself! Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Handle pointers to kernel strings nicerSteven Rostedt2009-11-24
| | | | | | | | | Some trace events point to strings within the kernel, and print them with '%s'. Since the stored value is just a pointer, unless we export those strings we can't print them out. Instead of trying to print out garbage (a string pointer), print out the value instead. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Add in missing break for '[' opSteven Rostedt2009-11-24
| | | | | | | | The addition of the dynamic array for '[' handling, broke the print field handling of the '[' op. The conversion to a switch statement forgot to add in a proper 'break'. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Handle %pM/%pmJohannes Berg2009-11-24
| | | | | | | This adds handling for the MAC address format specifiers to trace-cmd. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Ignore '.' in print formatSteven Rostedt2009-11-23
| | | | | | | | Ignore the uses of '.' in printf format. We need to eventually handle all printf cases. But for now, just ignore some of the corner cases. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Add handling of __get_dynamic_arraySteven Rostedt2009-11-23
| | | | | | | This adds some code to handle direct uses of __dynamic_array. It still needs to handle the type casting for it. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Print out the event files stored in a data fileSteven Rostedt2009-11-23
| | | | | | Add -E option to print out the event files stored in a data file. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Fix print outputSteven Rostedt2009-11-23
| | | | | | | | The standard print statement would use a zero size field for the string data. This was not handled well, and the print statement never printed any data. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Handle large trace entriesSteven Rostedt2009-11-23
| | | | | | | | | | | | During testing, all the events fit in the small event catagory. I never was able to test large events. I added a "die" command so that I would know of a large event to make sure it got tested. Finally, I got around to testing the large events, as others have been hitting the die statement. Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Add comment for '#' workaroundSteven Rostedt2009-11-23
| | | | | | | The '#' is just a work around and needs to be correct. Add a comment to remind us to fix this later. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* "handle" alternate printf formatJohannes Berg2009-11-23
| | | | | | | | | The '#' can be ignored most of the time, right now we always print %x as 0x... for instance, so the # adds nothing. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Handle old formatSteven Rostedt2009-11-20
| | | | | | | | | Update to read the old file format for 2.6.30. It is very limited, but can process a little. Unfortunately, the printk_formats file is broken for 2.6.30. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Do not die on bad op in process_opSteven Rostedt2009-11-20
| | | | | | | Instead of killing the program, simply warn and continue when we encounter a bad op. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* reset max latencySteven Rostedt2009-11-20
| | | | | | When running one of the latency tracers, reset the max latency. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Add make TAGSSteven Rostedt2009-11-20
| | | | | | Create entry TAGS to create etags. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Fix up function graph time spacingSteven Rostedt2009-11-20
| | | | | | | The conversion of the parse-events.c to use trace-seq, broke the spacing of the function graph tracer timings. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Separate out tracing setup functionsSteven Rostedt2009-11-16
| | | | | | | The functions that set up reading the data files may be used by other routines. Separate them out into their own functions. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* fix reading of string from fileSteven Rostedt2009-11-16
| | | | | | | | Reading the string from the trace file did not zero out the end of the string. This caused funny characters to appear at the end of the version listing. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* don't fail if ftrace_enable is not thereSteven Rostedt2009-11-16
| | | | | | | We should still be able to do tracing if the kernel was not compiled with function tracer. Don't fail on failure to read ftrace_enable. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Convert parse-envents.c to use trace_seq for outputSteven Rostedt2009-11-16
| | | | | | | To allow other users to take adavantage of the parse-events code, convert it to trace_seq. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* change input_fd to globalSteven Rostedt2009-11-16
| | | | | | | Other parts of the tracer may need to reference the data file. Make it global. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* Add trace-seqSteven Rostedt2009-11-16
| | | | | | | | | The trace-seq is a nice utility I wrote for Linux. It makes a page size buffer that that can be written to with a printf,puts,putc interface. This is perfect for having the same routine write the same type of output, and used separately. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
* add -std=gnu99 to compilingSteven Rostedt2009-10-14
| | | | | | | | | Perf uses -std=gnu99 which causes some strange side effects. To keep parse-events.c close to what is in perf, we use the same option. Namely, it makes us typecast the options for "%a" in the sscanf to float. Signed-off-by: Steven Rostedt <srostedt@redhat.com>