Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205264
b: refs/heads/master
c: a1ac1d3
h: refs/heads/master
v: v3
  • Loading branch information
Stephane Eranian authored and Arnaldo Carvalho de Melo committed Jun 17, 2010
1 parent 82c1e01 commit e0ac747
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70c3856b2f1304e0abc65f1b96a8c60ddfc0fb9e
refs/heads/master: a1ac1d3c085420ea8c809ebbee3bb212ed3616bd
6 changes: 6 additions & 0 deletions trunk/tools/perf/Documentation/perf-record.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ comma-sperated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2
In per-thread mode with inheritance mode on (default), samples are captured only when
the thread executes on the designated CPUs. Default is to monitor all CPUs.

-N::
--no-buildid-cache::
Do not update the builid cache. This saves some overhead in situations
where the information in the perf.data file (which includes buildids)
is sufficient.

SEE ALSO
--------
linkperf:perf-stat[1], linkperf:perf-list[1]
5 changes: 5 additions & 0 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static bool call_graph = false;
static bool inherit_stat = false;
static bool no_samples = false;
static bool sample_address = false;
static bool no_buildid = false;

static long samples = 0;
static u64 bytes_written = 0;
Expand Down Expand Up @@ -825,6 +826,8 @@ static const struct option options[] = {
"Sample addresses"),
OPT_BOOLEAN('n', "no-samples", &no_samples,
"don't sample"),
OPT_BOOLEAN('N', "no-buildid-cache", &no_buildid,
"do not update the buildid cache"),
OPT_END()
};

Expand All @@ -849,6 +852,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
}

symbol__init();
if (no_buildid)
disable_buildid_cache();

if (!nr_counters) {
nr_counters = 1;
Expand Down
10 changes: 9 additions & 1 deletion trunk/tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "symbol.h"
#include "debug.h"

static bool no_buildid_cache = false;

/*
* Create new perf.data header attribute:
*/
Expand Down Expand Up @@ -470,7 +472,8 @@ static int perf_header__adds_write(struct perf_header *self, int fd)
}
buildid_sec->size = lseek(fd, 0, SEEK_CUR) -
buildid_sec->offset;
perf_session__cache_build_ids(session);
if (!no_buildid_cache)
perf_session__cache_build_ids(session);
}

lseek(fd, sec_start, SEEK_SET);
Expand Down Expand Up @@ -1189,3 +1192,8 @@ int event__process_build_id(event_t *self,
session);
return 0;
}

void disable_buildid_cache(void)
{
no_buildid_cache = true;
}
1 change: 1 addition & 0 deletions trunk/tools/perf/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ extern void set_die_routine(void (*routine)(const char *err, va_list params) NOR

extern int prefixcmp(const char *str, const char *prefix);
extern void set_buildid_dir(void);
extern void disable_buildid_cache(void);

static inline const char *skip_prefix(const char *str, const char *prefix)
{
Expand Down

0 comments on commit e0ac747

Please sign in to comment.