Skip to contentSkip to conversation

tools/bpf: matric typo erro

PATCH Applied Swan Beaujard 3 participants 3 messages Jun 2, 2024 – Jun 3, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/bpf: matric typo erro

Corrected typo in bpftool profiler.

Changed all instances of 'MATRICS' to 'METRICS' in the profiler.bpf.c file.

---
 tools/bpf/bpftool/skeleton/profiler.bpf.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
tools/bpf/bpftool/skeleton/profiler.bpf.c +7 -7
index 2f80edc68..f48c783cb 100644
@@ -40,17 +40,17 @@ struct {
 
 const volatile __u32 num_cpu = 1;
 const volatile __u32 num_metric = 1;
-#define MAX_NUM_MATRICS 4
+#define MAX_NUM_METRICS 4
 
 SEC("fentry/XXX")
 int BPF_PROG(fentry_XXX)
 {
-	struct bpf_perf_event_value___local *ptrs[MAX_NUM_MATRICS];
+	struct bpf_perf_event_value___local *ptrs[MAX_NUM_METRICS];
 	u32 key = bpf_get_smp_processor_id();
 	u32 i;
 
 	/* look up before reading, to reduce error */
-	for (i = 0; i < num_metric && i < MAX_NUM_MATRICS; i++) {
+	for (i = 0; i < num_metric && i < MAX_NUM_METRICS; i++) {
 		u32 flag = i;
 
 		ptrs[i] = bpf_map_lookup_elem(&fentry_readings, &flag);
@@ -58,7 +58,7 @@ int BPF_PROG(fentry_XXX)
 			return 0;
 	}
 
-	for (i = 0; i < num_metric && i < MAX_NUM_MATRICS; i++) {
+	for (i = 0; i < num_metric && i < MAX_NUM_METRICS; i++) {
 		struct bpf_perf_event_value___local reading;
 		int err;
 
@@ -99,14 +99,14 @@ fexit_update_maps(u32 id, struct bpf_perf_event_value___local *after)
 SEC("fexit/XXX")
 int BPF_PROG(fexit_XXX)
 {
-	struct bpf_perf_event_value___local readings[MAX_NUM_MATRICS];
+	struct bpf_perf_event_value___local readings[MAX_NUM_METRICS];
 	u32 cpu = bpf_get_smp_processor_id();
 	u32 i, zero = 0;
 	int err;
 	u64 *count;
 
 	/* read all events before updating the maps, to reduce error */
-	for (i = 0; i < num_metric && i < MAX_NUM_MATRICS; i++) {
+	for (i = 0; i < num_metric && i < MAX_NUM_METRICS; i++) {
 		err = bpf_perf_event_read_value(&events, cpu + i * num_cpu,
 						(void *)(readings + i),
 						sizeof(*readings));
@@ -116,7 +116,7 @@ int BPF_PROG(fexit_XXX)
 	count = bpf_map_lookup_elem(&counts, &zero);
 	if (count) {
 		*count += 1;
-		for (i = 0; i < num_metric && i < MAX_NUM_MATRICS; i++)
+		for (i = 0; i < num_metric && i < MAX_NUM_METRICS; i++)
 			fexit_update_maps(i, &readings[i]);
 	}
 	return 0;
Signature · 1 line
2.39.3 (Apple Git-146)
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Swan Beaujard

Corrected typo in bpftool profiler.

Changed all instances of 'MATRICS' to 'METRICS' in the profiler.bpf.c file.

For future bpftool patches, please use directly "bpftool:" rather than "tools/bpf:" as component prefix for the commit object, and make sure to have a clear title ("erro" seems to be a typo itself).

Thanks!

#2 lore raw
In reply to Swan Beaujard
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Quoted 8 lines · On Mon, 3 Jun 2024 00:58:12 +0200 you wrote:

Corrected typo in bpftool profiler.

Changed all instances of 'MATRICS' to 'METRICS' in the profiler.bpf.c file.

---
 tools/bpf/bpftool/skeleton/profiler.bpf.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Here is the summary with links:
- tools/bpf: matric typo erro

    https://git.kernel.org/bpf/bpf-next/c/ce5249b91e34

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html