linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org,
	Song Liu <songliubraving@fb.com>,
	bpf@vger.kernel.org
Subject: [PATCH 2/4] perf bpf_counter: Increase perf_attr_map entries to 32
Date: Tue,  3 Jan 2023 22:44:00 -0800	[thread overview]
Message-ID: <20230104064402.1551516-3-namhyung@kernel.org> (raw)
In-Reply-To: <20230104064402.1551516-1-namhyung@kernel.org>

The current size 16 cannot hold all events when user gave -dd or -ddd.
As it's a part of perf stat, let's increase the size to 32.

  # unlink previous map to change the size
  $ sudo unlink /sys/fs/bpf/perf_attr_map

  $ sudo ./perf stat -a --bpf-counters -ddd sleep 1

   Performance counter stats for 'system wide':

           35,927.41 msec cpu-clock                        #   35.802 CPUs utilized
              12,629      context-switches                 #  351.514 /sec
                 209      cpu-migrations                   #    5.817 /sec
                 826      page-faults                      #   22.991 /sec
       2,155,729,621      cycles                           #    0.060 GHz                         (30.43%)
       1,053,849,500      instructions                     #    0.49  insn per cycle              (38.18%)
         232,711,500      branches                         #    6.477 M/sec                       (38.44%)
          10,693,352      branch-misses                    #    4.60% of all branches             (31.27%)
         267,561,655      L1-dcache-loads                  #    7.447 M/sec                       (30.58%)
          27,290,728      L1-dcache-load-misses            #   10.20% of all L1-dcache accesses   (30.48%)
          12,651,208      LLC-loads                        #  352.133 K/sec                       (30.78%)
           1,274,018      LLC-load-misses                  #   10.07% of all LL-cache accesses    (38.70%)
     <not supported>      L1-icache-loads
          75,916,358      L1-icache-load-misses            #    0.00% of all L1-icache accesses   (38.11%)
         273,330,559      dTLB-loads                       #    7.608 M/sec                       (30.54%)
           2,864,458      dTLB-load-misses                 #    1.05% of all dTLB cache accesses  (38.77%)
             361,507      iTLB-loads                       #   10.062 K/sec                       (30.59%)
             848,031      iTLB-load-misses                 #  234.58% of all iTLB cache accesses  (31.30%)
     <not supported>      L1-dcache-prefetches
     <not supported>      L1-dcache-prefetch-misses

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/bpf_counter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/bpf_counter.c b/tools/perf/util/bpf_counter.c
index 7f5cc1aa4903..de6331f5263c 100644
--- a/tools/perf/util/bpf_counter.c
+++ b/tools/perf/util/bpf_counter.c
@@ -28,7 +28,7 @@
 #include "bpf_skel/bperf_leader.skel.h"
 #include "bpf_skel/bperf_follower.skel.h"
 
-#define ATTR_MAP_SIZE 16
+#define ATTR_MAP_SIZE 32
 
 static inline void *u64_to_ptr(__u64 ptr)
 {
-- 
2.39.0.314.g84b9a713c41-goog


  parent reply	other threads:[~2023-01-04  6:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04  6:43 [PATCH 0/4] perf bpf_counter: A set of random fixes (v1) Namhyung Kim
2023-01-04  6:43 ` [PATCH 1/4] perf bpf_counter: Add more error messages for bperf Namhyung Kim
2023-01-04  6:44 ` Namhyung Kim [this message]
2023-01-04  6:44 ` [PATCH 3/4] perf bpf_counter: Handle unsupported cgroup events Namhyung Kim
2023-01-04 13:51   ` Arnaldo Carvalho de Melo
2023-01-04  6:44 ` [PATCH 4/4] perf stat: Do not use the same cgroup more than once Namhyung Kim
2023-01-04 14:21   ` Arnaldo Carvalho de Melo
2023-01-04 14:21 ` [PATCH 0/4] perf bpf_counter: A set of random fixes (v1) Arnaldo Carvalho de Melo

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=20230104064402.1551516-3-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).