[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250123142339.990300-3-tglozar@redhat.com>
Date: Thu, 23 Jan 2025 15:23:37 +0100
From: Tomas Glozar <tglozar@...hat.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-trace-kernel@...r.kernel.org,
linux-kernel@...r.kernel.org,
John Kacur <jkacur@...hat.com>,
Luis Goncalves <lgoncalv@...hat.com>,
Gabriele Monaco <gmonaco@...hat.com>,
Tomas Glozar <tglozar@...hat.com>
Subject: [PATCH 2/4] rtla: Count all processed events
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 percentange of events that were missed
due to tracefs buffer overflow.
Signed-off-by: Tomas Glozar <tglozar@...hat.com>
---
tools/tracing/rtla/src/trace.c | 4 ++++
tools/tracing/rtla/src/trace.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/tools/tracing/rtla/src/trace.c b/tools/tracing/rtla/src/trace.c
index 69a6bd2b3746..b9c4b6c2ce79 100644
--- a/tools/tracing/rtla/src/trace.c
+++ b/tools/tracing/rtla/src/trace.c
@@ -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:
diff --git a/tools/tracing/rtla/src/trace.h b/tools/tracing/rtla/src/trace.h
index 027cb66f5604..2fd96cf36ce7 100644
--- a/tools/tracing/rtla/src/trace.h
+++ b/tools/tracing/rtla/src/trace.h
@@ -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);
--
2.48.1
Powered by blists - more mailing lists