Loading tools/perf/builtin-record.c +2 −17 Original line number Diff line number Diff line Loading @@ -30,8 +30,6 @@ #include <sched.h> #include <sys/mman.h> #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y)) enum write_mode_t { WRITE_FORCE, WRITE_APPEND Loading Loading @@ -438,7 +436,6 @@ static void mmap_read_all(void) static int __cmd_record(int argc, const char **argv) { int i; struct stat st; int flags; int err; Loading Loading @@ -682,7 +679,6 @@ static int __cmd_record(int argc, const char **argv) for (;;) { int hits = samples; int thread; mmap_read_all(); Loading @@ -693,19 +689,8 @@ static int __cmd_record(int argc, const char **argv) waking++; } if (done) { for (i = 0; i < evsel_list->cpus->nr; i++) { struct perf_evsel *pos; list_for_each_entry(pos, &evsel_list->entries, node) { for (thread = 0; thread < evsel_list->threads->nr; thread++) ioctl(FD(pos, i, thread), PERF_EVENT_IOC_DISABLE); } } } if (done) perf_evlist__disable(evsel_list); } if (quiet || signr == SIGUSR1) Loading tools/perf/builtin-report.c +7 −8 Original line number Diff line number Diff line Loading @@ -162,23 +162,22 @@ static int perf_session__setup_sample_type(struct perf_session *self) { if (!(self->sample_type & PERF_SAMPLE_CALLCHAIN)) { if (sort__has_parent) { fprintf(stderr, "selected --sort parent, but no" ui__warning("Selected --sort parent, but no " "callchain data. Did you call " " perf record without -g?\n"); "'perf record' without -g?\n"); return -EINVAL; } if (symbol_conf.use_callchain) { fprintf(stderr, "selected -g but no callchain data." " Did you call perf record without" " -g?\n"); ui__warning("Selected -g but no callchain data. Did " "you call 'perf record' without -g?\n"); return -1; } } else if (!dont_use_callchains && callchain_param.mode != CHAIN_NONE && !symbol_conf.use_callchain) { symbol_conf.use_callchain = true; if (callchain_register_param(&callchain_param) < 0) { fprintf(stderr, "Can't register callchain" " params\n"); ui__warning("Can't register callchain " "params.\n"); return -EINVAL; } } Loading tools/perf/util/evlist.c +13 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,19 @@ int perf_evlist__add_default(struct perf_evlist *evlist) return 0; } void perf_evlist__disable(struct perf_evlist *evlist) { int cpu, thread; struct perf_evsel *pos; for (cpu = 0; cpu < evlist->cpus->nr; cpu++) { list_for_each_entry(pos, &evlist->entries, node) { for (thread = 0; thread < evlist->threads->nr; thread++) ioctl(FD(pos, cpu, thread), PERF_EVENT_IOC_DISABLE); } } } int perf_evlist__alloc_pollfd(struct perf_evlist *evlist) { int nfds = evlist->cpus->nr * evlist->threads->nr * evlist->nr_entries; Loading tools/perf/util/evlist.h +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ int perf_evlist__alloc_mmap(struct perf_evlist *evlist); int perf_evlist__mmap(struct perf_evlist *evlist, int pages, bool overwrite); void perf_evlist__munmap(struct perf_evlist *evlist); void perf_evlist__disable(struct perf_evlist *evlist); static inline void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus, struct thread_map *threads) Loading tools/perf/util/header.c +4 −4 Original line number Diff line number Diff line Loading @@ -189,8 +189,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, const char *name, bool is_kallsyms) { const size_t size = PATH_MAX; char *realname, *filename = malloc(size), *linkname = malloc(size), *targetname; char *realname, *filename = zalloc(size), *linkname = zalloc(size), *targetname; int len, err = -1; if (is_kallsyms) { Loading Loading @@ -254,8 +254,8 @@ static int build_id_cache__add_b(const u8 *build_id, size_t build_id_size, int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir) { const size_t size = PATH_MAX; char *filename = malloc(size), *linkname = malloc(size); char *filename = zalloc(size), *linkname = zalloc(size); int err = -1; if (filename == NULL || linkname == NULL) Loading Loading
tools/perf/builtin-record.c +2 −17 Original line number Diff line number Diff line Loading @@ -30,8 +30,6 @@ #include <sched.h> #include <sys/mman.h> #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y)) enum write_mode_t { WRITE_FORCE, WRITE_APPEND Loading Loading @@ -438,7 +436,6 @@ static void mmap_read_all(void) static int __cmd_record(int argc, const char **argv) { int i; struct stat st; int flags; int err; Loading Loading @@ -682,7 +679,6 @@ static int __cmd_record(int argc, const char **argv) for (;;) { int hits = samples; int thread; mmap_read_all(); Loading @@ -693,19 +689,8 @@ static int __cmd_record(int argc, const char **argv) waking++; } if (done) { for (i = 0; i < evsel_list->cpus->nr; i++) { struct perf_evsel *pos; list_for_each_entry(pos, &evsel_list->entries, node) { for (thread = 0; thread < evsel_list->threads->nr; thread++) ioctl(FD(pos, i, thread), PERF_EVENT_IOC_DISABLE); } } } if (done) perf_evlist__disable(evsel_list); } if (quiet || signr == SIGUSR1) Loading
tools/perf/builtin-report.c +7 −8 Original line number Diff line number Diff line Loading @@ -162,23 +162,22 @@ static int perf_session__setup_sample_type(struct perf_session *self) { if (!(self->sample_type & PERF_SAMPLE_CALLCHAIN)) { if (sort__has_parent) { fprintf(stderr, "selected --sort parent, but no" ui__warning("Selected --sort parent, but no " "callchain data. Did you call " " perf record without -g?\n"); "'perf record' without -g?\n"); return -EINVAL; } if (symbol_conf.use_callchain) { fprintf(stderr, "selected -g but no callchain data." " Did you call perf record without" " -g?\n"); ui__warning("Selected -g but no callchain data. Did " "you call 'perf record' without -g?\n"); return -1; } } else if (!dont_use_callchains && callchain_param.mode != CHAIN_NONE && !symbol_conf.use_callchain) { symbol_conf.use_callchain = true; if (callchain_register_param(&callchain_param) < 0) { fprintf(stderr, "Can't register callchain" " params\n"); ui__warning("Can't register callchain " "params.\n"); return -EINVAL; } } Loading
tools/perf/util/evlist.c +13 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,19 @@ int perf_evlist__add_default(struct perf_evlist *evlist) return 0; } void perf_evlist__disable(struct perf_evlist *evlist) { int cpu, thread; struct perf_evsel *pos; for (cpu = 0; cpu < evlist->cpus->nr; cpu++) { list_for_each_entry(pos, &evlist->entries, node) { for (thread = 0; thread < evlist->threads->nr; thread++) ioctl(FD(pos, cpu, thread), PERF_EVENT_IOC_DISABLE); } } } int perf_evlist__alloc_pollfd(struct perf_evlist *evlist) { int nfds = evlist->cpus->nr * evlist->threads->nr * evlist->nr_entries; Loading
tools/perf/util/evlist.h +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ int perf_evlist__alloc_mmap(struct perf_evlist *evlist); int perf_evlist__mmap(struct perf_evlist *evlist, int pages, bool overwrite); void perf_evlist__munmap(struct perf_evlist *evlist); void perf_evlist__disable(struct perf_evlist *evlist); static inline void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus, struct thread_map *threads) Loading
tools/perf/util/header.c +4 −4 Original line number Diff line number Diff line Loading @@ -189,8 +189,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, const char *name, bool is_kallsyms) { const size_t size = PATH_MAX; char *realname, *filename = malloc(size), *linkname = malloc(size), *targetname; char *realname, *filename = zalloc(size), *linkname = zalloc(size), *targetname; int len, err = -1; if (is_kallsyms) { Loading Loading @@ -254,8 +254,8 @@ static int build_id_cache__add_b(const u8 *build_id, size_t build_id_size, int build_id_cache__remove_s(const char *sbuild_id, const char *debugdir) { const size_t size = PATH_MAX; char *filename = malloc(size), *linkname = malloc(size); char *filename = zalloc(size), *linkname = zalloc(size); int err = -1; if (filename == NULL || linkname == NULL) Loading