summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-11-06rasd: Log events data to the data fileHEADmasterJean Pihet2-3/+4
stdout is not used anymore. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-14-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Log debug info and events data to filesJean Pihet1-7/+33
The log file is '/var/log/rasd.log'; the data file is '/var/log/rasd.data'. Note: all debug and informational messages go to the log file; stderr is not used anymore. Boris: - s/open_output_files/open_log_files/g - cleanup in the error case in open_log_files - move success message to the end of daemonize(), after we've passed all checks Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-13-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Daemonize the processJean Pihet1-0/+46
The process is put in the background and is detached from the TTYs. The process working dir is set to '/'. stdin, stdout and stderr are closed and cannot be used anymore. Note: the config file 'rasd.cfg' is expected in the working dir. Boris: - simplify error paths - cleanup excessive comments Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-12-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Read the events data and print out the events fieldsJean Pihet3-0/+75
Read the mmapped buffers and dump out events in the following format: <sys>:<name>: <kernel format>\n Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-11-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Use the event ID from the event formatJean Pihet2-3/+5
The ID field of every event is included in the event format. Use the ID as provided by the format parsing code. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-10-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Add event format parsingJean Pihet4-2/+97
Parse the events format from debugfs entry, i.e. (debugfs)/tracing/events/<sys>/<name>/format. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-9-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Sdd format read & parse from the kernel filesJean Pihet6-2/+7364
Added in order to have a stand-alone build. Ultimately rasd will need to link the traceevent lib from the kernel. Files copied from: . tools/lib/traceevent/event-parse.h, . tools/lib/traceevent/event-parse.c, . include/linux/trace_seq.h, . tools/lib/traceevent/trace-seq.c. and adapted for the build to succeed. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-8-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Enable system wide tracing, on all CPUsJean Pihet1-15/+22
Map the events buffers on all CPUs; set cpu and threads maps in evlist. The maps are used to parse the per-cpu and per-thread events. Note: rasd performs system-wide tracing, however at least one thread mapping is required. Create one thread mapping for the current PID. Boris: - make add_tp_event() void - cleanup excessive comments Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-7-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Enable and use events idsJean Pihet2-2/+37
Every event has an internal id calculated, it is used to map the requested events to the received ones. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-6-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Parse config file for events to enableJean Pihet1-11/+69
The file 'rasd.cfg' is parsed for options: .the events to enable are stored line by line. The format is 'sys:name', .a line starting with '#' is a comment and is ignored, .a line full of spaces and/or tabs is empty and is ignored. Boris: rewrite cfg_valid_line() to use regex(3). We want to select only the "interesting" lines and ignore everything else. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-4-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Add example config fileJean Pihet1-0/+7
rasd.cfg config file with event in the 'sys:name' format. Mutliple events can be specified, line by line. A line starting with '#' is considered as a comment and is ignored. A line full of spaces and/or tabs is empty and is ignored. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-5-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Add the requested tracepoint to evlistJean Pihet1-3/+61
Look for the requested tracepoint from the name and add it to the list of events to enable. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-3-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-11-06rasd: Define internal structsJean Pihet1-0/+8
... to manage events' attributes. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1412933690-25576-2-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-09-19rasd: Add a .gitignore fileJean Pihet1-0/+57
To have a nicer git status output. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1410516745-22131-7-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-09-09rasd: Find and mount debugfsJean Pihet1-0/+7
Used to look for requested events in debugfs. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1410164799-22589-2-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-08-07rasd: Add ARM64-specific definesJean Pihet1-0/+6
Use the memory barriers and cpu_relax from the linux kernel perf tool code at tools/perf/perf-sys.h. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1407425992-5657-3-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-08-07rasd: Add ARM-specific definesJean Pihet1-0/+10
Use the memory barriers and cpu_relax from the linux kernel perf tool code at tools/perf/perf-sys.h. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1407425992-5657-2-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-08-07rasd: Get rid of the harcoded syscall numberJean Pihet1-3/+1
Use the standard include file. Signed-off-by: Jean Pihet <jean.pihet@linaro.org> Link: http://lkml.kernel.org/r/1407425992-5657-1-git-send-email-jean.pihet@linaro.org Signed-off-by: Borislav Petkov <bp@suse.de>
2014-07-25Initial commitBorislav Petkov48-0/+7864
Signed-off-by: Borislav Petkov <bp@suse.de>