]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtla: Count all processed events
authorTomas Glozar <tglozar@redhat.com>
Thu, 23 Jan 2025 14:23:37 +0000 (15:23 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 24 Jan 2025 18:46:24 +0000 (13:46 -0500)
Add a field processed_events to struct trace_instance and increment it
in collect_registered_events, regardless of whether a handler is
registered for the event.

The purpose is to calculate the percentage of events that were missed
due to tracefs buffer overflow.

Cc: John Kacur <jkacur@redhat.com>
Cc: Luis Goncalves <lgoncalv@redhat.com>
Cc: Gabriele Monaco <gmonaco@redhat.com>
Link: https://lore.kernel.org/20250123142339.990300-3-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
tools/tracing/rtla/src/trace.c
tools/tracing/rtla/src/trace.h

index 94e490782f1414e24f64d37e61ae04489f3f7b4b..728f5029d5335fd510c619d4c886b3aa04384080 100644 (file)
@@ -118,6 +118,8 @@ collect_registered_events(struct tep_event *event, struct tep_record *record,
        struct trace_instance *trace = context;
        struct trace_seq *s = trace->seq;
 
+       trace->processed_events++;
+
        if (!event->handler)
                return 0;
 
@@ -215,6 +217,8 @@ int trace_instance_init(struct trace_instance *trace, char *tool_name)
                                     collect_missed_events,
                                     trace);
 
+       trace->processed_events = 0;
+
        return 0;
 
 out_err:
index a6e88709604b0433e096b765371c7aa3f1f354e3..3cd40dd3f06c3b2dfd2a21bb8178b357d191a3c8 100644 (file)
@@ -18,6 +18,7 @@ struct trace_instance {
        struct tep_handle               *tep;
        struct trace_seq                *seq;
        unsigned long long              missed_events;
+       unsigned long long              processed_events;
 };
 
 int trace_instance_init(struct trace_instance *trace, char *tool_name);