All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: void@manifault.com, arighi@nvidia.com, multics69@gmail.com
Cc: linux-kernel@vger.kernel.org, sched-ext@meta.com,
	Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/3] tool/sched_ext: Event counter dumping updates
Date: Fri,  7 Feb 2025 22:42:15 -1000	[thread overview]
Message-ID: <20250208084229.1274399-2-tj@kernel.org> (raw)
In-Reply-To: <20250208084229.1274399-1-tj@kernel.org>

- There's no need to dump event counters from both scx_qmap and scx_central.
  Drop counter dumping from scx_central.

- bpf_printk() implies a trailing new line and the explicit new line leads
  to double new lines. Drop the explicit new lines.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 tools/sched_ext/scx_central.bpf.c | 21 ---------------------
 tools/sched_ext/scx_qmap.bpf.c    | 16 ++++++++--------
 2 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/tools/sched_ext/scx_central.bpf.c b/tools/sched_ext/scx_central.bpf.c
index 907a844723c1..5c165af1fa27 100644
--- a/tools/sched_ext/scx_central.bpf.c
+++ b/tools/sched_ext/scx_central.bpf.c
@@ -293,27 +293,6 @@ static int central_timerfn(void *map, int *key, struct bpf_timer *timer)
 	bpf_timer_start(timer, TIMER_INTERVAL_NS, BPF_F_TIMER_CPU_PIN);
 	__sync_fetch_and_add(&nr_timers, 1);
 
-	/* print event counters every second */
-	if (nr_timers % 1000 == 0) {
-		scx_bpf_events(&events, sizeof(events));
-
-		bpf_printk("%35s: %llu\n", "SCX_EV_SELECT_CPU_FALLBACK",
-			   scx_read_event(&events, SCX_EV_SELECT_CPU_FALLBACK));
-		bpf_printk("%35s: %llu\n", "SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE",
-			   scx_read_event(&events, SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE));
-		bpf_printk("%35s: %llu\n", "SCX_EV_DISPATCH_KEEP_LAST",
-			   scx_read_event(&events, SCX_EV_DISPATCH_KEEP_LAST));
-		bpf_printk("%35s: %llu\n", "SCX_EV_ENQ_SKIP_EXITING",
-			   scx_read_event(&events, SCX_EV_ENQ_SKIP_EXITING));
-		bpf_printk("%35s: %llu\n", "SCX_EV_ENQ_SLICE_DFL",
-			   scx_read_event(&events, SCX_EV_ENQ_SLICE_DFL));
-		bpf_printk("%35s: %llu\n", "SCX_EV_BYPASS_DURATION",
-			   scx_read_event(&events, SCX_EV_BYPASS_DURATION));
-		bpf_printk("%35s: %llu\n", "SCX_EV_BYPASS_DISPATCH",
-			   scx_read_event(&events, SCX_EV_BYPASS_DISPATCH));
-		bpf_printk("%35s: %llu\n", "SCX_EV_BYPASS_ACTIVATE",
-			   scx_read_event(&events, SCX_EV_BYPASS_ACTIVATE));
-	}
 	return 0;
 }
 
diff --git a/tools/sched_ext/scx_qmap.bpf.c b/tools/sched_ext/scx_qmap.bpf.c
index 7d9d1e5d2358..e0e766d402e1 100644
--- a/tools/sched_ext/scx_qmap.bpf.c
+++ b/tools/sched_ext/scx_qmap.bpf.c
@@ -776,21 +776,21 @@ static int monitor_timerfn(void *map, int *key, struct bpf_timer *timer)
 
 	scx_bpf_events(&events, sizeof(events));
 
-	bpf_printk("%35s: %llu\n", "SCX_EV_SELECT_CPU_FALLBACK",
+	bpf_printk("%35s: %llu", "SCX_EV_SELECT_CPU_FALLBACK",
 		   scx_read_event(&events, SCX_EV_SELECT_CPU_FALLBACK));
-	bpf_printk("%35s: %llu\n", "SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE",
+	bpf_printk("%35s: %llu", "SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE",
 		   scx_read_event(&events, SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE));
-	bpf_printk("%35s: %llu\n", "SCX_EV_DISPATCH_KEEP_LAST",
+	bpf_printk("%35s: %llu", "SCX_EV_DISPATCH_KEEP_LAST",
 		   scx_read_event(&events, SCX_EV_DISPATCH_KEEP_LAST));
-	bpf_printk("%35s: %llu\n", "SCX_EV_ENQ_SKIP_EXITING",
+	bpf_printk("%35s: %llu", "SCX_EV_ENQ_SKIP_EXITING",
 		   scx_read_event(&events, SCX_EV_ENQ_SKIP_EXITING));
-	bpf_printk("%35s: %llu\n", "SCX_EV_ENQ_SLICE_DFL",
+	bpf_printk("%35s: %llu", "SCX_EV_ENQ_SLICE_DFL",
 		   scx_read_event(&events, SCX_EV_ENQ_SLICE_DFL));
-	bpf_printk("%35s: %llu\n", "SCX_EV_BYPASS_DURATION",
+	bpf_printk("%35s: %llu", "SCX_EV_BYPASS_DURATION",
 		   scx_read_event(&events, SCX_EV_BYPASS_DURATION));
-	bpf_printk("%35s: %llu\n", "SCX_EV_BYPASS_DISPATCH",
+	bpf_printk("%35s: %llu", "SCX_EV_BYPASS_DISPATCH",
 		   scx_read_event(&events, SCX_EV_BYPASS_DISPATCH));
-	bpf_printk("%35s: %llu\n", "SCX_EV_BYPASS_ACTIVATE",
+	bpf_printk("%35s: %llu", "SCX_EV_BYPASS_ACTIVATE",
 		   scx_read_event(&events, SCX_EV_BYPASS_ACTIVATE));
 
 	bpf_timer_start(timer, ONE_SEC_IN_NS, 0);
-- 
2.48.1


  reply	other threads:[~2025-02-08  8:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-08  8:42 [PATCHSET sched_ext/for-6.15] sched_ext: Event counter updates Tejun Heo
2025-02-08  8:42 ` Tejun Heo [this message]
2025-02-08  8:42 ` [PATCH 2/3] sched_ext: Count SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE in the right spot Tejun Heo
2025-02-08  8:42 ` [PATCH 3/3] sched_ext: Add SCX_EV_ENQ_SKIP_MIGRATION_DISABLED Tejun Heo
2025-02-08  9:12 ` [PATCHSET sched_ext/for-6.15] sched_ext: Event counter updates Changwoo Min
2025-02-09  6:40 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250208084229.1274399-2-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=multics69@gmail.com \
    --cc=sched-ext@meta.com \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.