aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Documentation/perf-record.txt6
-rw-r--r--tools/perf/builtin-record.c5
-rw-r--r--tools/perf/util/header.c10
-rw-r--r--tools/perf/util/util.h1
4 files changed, 21 insertions, 1 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 25576b477c83..3ee27dccfde9 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -110,6 +110,12 @@ comma-sperated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2
110In per-thread mode with inheritance mode on (default), samples are captured only when 110In per-thread mode with inheritance mode on (default), samples are captured only when
111the thread executes on the designated CPUs. Default is to monitor all CPUs. 111the thread executes on the designated CPUs. Default is to monitor all CPUs.
112 112
113-N::
114--no-buildid-cache::
115Do not update the builid cache. This saves some overhead in situations
116where the information in the perf.data file (which includes buildids)
117is sufficient.
118
113SEE ALSO 119SEE ALSO
114-------- 120--------
115linkperf:perf-stat[1], linkperf:perf-list[1] 121linkperf:perf-stat[1], linkperf:perf-list[1]
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 5efc3fc68a36..86b1c3b6264e 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -60,6 +60,7 @@ static bool call_graph = false;
60static bool inherit_stat = false; 60static bool inherit_stat = false;
61static bool no_samples = false; 61static bool no_samples = false;
62static bool sample_address = false; 62static bool sample_address = false;
63static bool no_buildid = false;
63 64
64static long samples = 0; 65static long samples = 0;
65static u64 bytes_written = 0; 66static u64 bytes_written = 0;
@@ -825,6 +826,8 @@ static const struct option options[] = {
825 "Sample addresses"), 826 "Sample addresses"),
826 OPT_BOOLEAN('n', "no-samples", &no_samples, 827 OPT_BOOLEAN('n', "no-samples", &no_samples,
827 "don't sample"), 828 "don't sample"),
829 OPT_BOOLEAN('N', "no-buildid-cache", &no_buildid,
830 "do not update the buildid cache"),
828 OPT_END() 831 OPT_END()
829}; 832};
830 833
@@ -849,6 +852,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
849 } 852 }
850 853
851 symbol__init(); 854 symbol__init();
855 if (no_buildid)
856 disable_buildid_cache();
852 857
853 if (!nr_counters) { 858 if (!nr_counters) {
854 nr_counters = 1; 859 nr_counters = 1;
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 4a6a4b3a4ab7..d7e67b167ea3 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -16,6 +16,8 @@
16#include "symbol.h" 16#include "symbol.h"
17#include "debug.h" 17#include "debug.h"
18 18
19static bool no_buildid_cache = false;
20
19/* 21/*
20 * Create new perf.data header attribute: 22 * Create new perf.data header attribute:
21 */ 23 */
@@ -470,7 +472,8 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
470 } 472 }
471 buildid_sec->size = lseek(fd, 0, SEEK_CUR) - 473 buildid_sec->size = lseek(fd, 0, SEEK_CUR) -
472 buildid_sec->offset; 474 buildid_sec->offset;
473 perf_session__cache_build_ids(session); 475 if (!no_buildid_cache)
476 perf_session__cache_build_ids(session);
474 } 477 }
475 478
476 lseek(fd, sec_start, SEEK_SET); 479 lseek(fd, sec_start, SEEK_SET);
@@ -1189,3 +1192,8 @@ int event__process_build_id(event_t *self,
1189 session); 1192 session);
1190 return 0; 1193 return 0;
1191} 1194}
1195
1196void disable_buildid_cache(void)
1197{
1198 no_buildid_cache = true;
1199}
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index de61441b6dd7..f380fed74359 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -154,6 +154,7 @@ extern void set_die_routine(void (*routine)(const char *err, va_list params) NOR
154 154
155extern int prefixcmp(const char *str, const char *prefix); 155extern int prefixcmp(const char *str, const char *prefix);
156extern void set_buildid_dir(void); 156extern void set_buildid_dir(void);
157extern void disable_buildid_cache(void);
157 158
158static inline const char *skip_prefix(const char *str, const char *prefix) 159static inline const char *skip_prefix(const char *str, const char *prefix)
159{ 160{