Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core updates from Arnaldo Carvalho de Melo:

Changes in user visible interfaces:

* Rename 'record's --no-delay option to --no-buffering, better reflecting its
purpose and freeing up '--delay' to take the place of '--initial-delay', so that
'record' and 'stat' are consistent.

Refactorings:

* Get rid of die() and friends (good riddance!) in libtraceevent (Namhyung Kim)

Infrastructure enhancements:

* Fix cross build problems related to pkgconfig and CROSS_COMPILE not being
propagated to the feature tests, leading to features being tested in the
host and then being enabled on the target. (Mark Rutland)

* Fix pointer-integer size mismatch in some libtraceevent plugins (Mark Rutland)

* Fix build error due to zfree() cast (Namhyung Kim)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>

+147 -147
+1 -1
tools/lib/traceevent/Makefile
··· 136 136 137 137 EVENT_PARSE_VERSION = $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION) 138 138 139 - INCLUDES = -I. $(CONFIG_INCLUDES) 139 + INCLUDES = -I. -I $(srctree)/../../include $(CONFIG_INCLUDES) 140 140 141 141 # Set compile option CFLAGS if not set elsewhere 142 142 CFLAGS ?= -g -Wall
+11 -3
tools/lib/traceevent/event-parse.h
··· 58 58 #endif 59 59 }; 60 60 61 + enum trace_seq_fail { 62 + TRACE_SEQ__GOOD, 63 + TRACE_SEQ__BUFFER_POISONED, 64 + TRACE_SEQ__MEM_ALLOC_FAILED, 65 + }; 66 + 61 67 /* 62 68 * Trace sequences are used to allow a function to call several other functions 63 69 * to create a string of data to use (up to a max of PAGE_SIZE). ··· 74 68 unsigned int buffer_size; 75 69 unsigned int len; 76 70 unsigned int readpos; 71 + enum trace_seq_fail state; 77 72 }; 78 73 79 74 void trace_seq_init(struct trace_seq *s); ··· 105 98 void *context); 106 99 107 100 typedef int (*pevent_plugin_load_func)(struct pevent *pevent); 108 - typedef int (*pevent_plugin_unload_func)(void); 101 + typedef int (*pevent_plugin_unload_func)(struct pevent *pevent); 109 102 110 103 struct plugin_option { 111 104 struct plugin_option *next; ··· 130 123 * PEVENT_PLUGIN_UNLOADER: (optional) 131 124 * The function called just before unloading 132 125 * 133 - * int PEVENT_PLUGIN_UNLOADER(void) 126 + * int PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 134 127 * 135 128 * PEVENT_PLUGIN_OPTIONS: (optional) 136 129 * Plugin options that can be set before loading ··· 411 404 struct plugin_list; 412 405 413 406 struct plugin_list *traceevent_load_plugins(struct pevent *pevent); 414 - void traceevent_unload_plugins(struct plugin_list *plugin_list); 407 + void traceevent_unload_plugins(struct plugin_list *plugin_list, 408 + struct pevent *pevent); 415 409 416 410 struct cmdline; 417 411 struct cmdline_list;
+2 -2
tools/lib/traceevent/event-plugin.c
··· 197 197 } 198 198 199 199 void 200 - traceevent_unload_plugins(struct plugin_list *plugin_list) 200 + traceevent_unload_plugins(struct plugin_list *plugin_list, struct pevent *pevent) 201 201 { 202 202 pevent_plugin_unload_func func; 203 203 struct plugin_list *list; ··· 207 207 plugin_list = list->next; 208 208 func = dlsym(list->handle, PEVENT_PLUGIN_UNLOADER_NAME); 209 209 if (func) 210 - func(); 210 + func(pevent); 211 211 dlclose(list->handle); 212 212 free(list->name); 213 213 free(list);
-4
tools/lib/traceevent/event-utils.h
··· 23 23 #include <ctype.h> 24 24 25 25 /* Can be overridden */ 26 - void die(const char *fmt, ...); 27 - void *malloc_or_die(unsigned int size); 28 26 void warning(const char *fmt, ...); 29 27 void pr_stat(const char *fmt, ...); 30 28 void vpr_stat(const char *fmt, va_list ap); 31 29 32 30 /* Always available */ 33 - void __die(const char *fmt, ...); 34 31 void __warning(const char *fmt, ...); 35 32 void __pr_stat(const char *fmt, ...); 36 33 37 - void __vdie(const char *fmt, ...); 38 34 void __vwarning(const char *fmt, ...); 39 35 void __vpr_stat(const char *fmt, ...); 40 36
-44
tools/lib/traceevent/parse-utils.c
··· 25 25 26 26 #define __weak __attribute__((weak)) 27 27 28 - void __vdie(const char *fmt, va_list ap) 29 - { 30 - int ret = errno; 31 - 32 - if (errno) 33 - perror("trace-cmd"); 34 - else 35 - ret = -1; 36 - 37 - fprintf(stderr, " "); 38 - vfprintf(stderr, fmt, ap); 39 - 40 - fprintf(stderr, "\n"); 41 - exit(ret); 42 - } 43 - 44 - void __die(const char *fmt, ...) 45 - { 46 - va_list ap; 47 - 48 - va_start(ap, fmt); 49 - __vdie(fmt, ap); 50 - va_end(ap); 51 - } 52 - 53 - void __weak die(const char *fmt, ...) 54 - { 55 - va_list ap; 56 - 57 - va_start(ap, fmt); 58 - __vdie(fmt, ap); 59 - va_end(ap); 60 - } 61 - 62 28 void __vwarning(const char *fmt, va_list ap) 63 29 { 64 30 if (errno) ··· 82 116 va_start(ap, fmt); 83 117 __vpr_stat(fmt, ap); 84 118 va_end(ap); 85 - } 86 - 87 - void __weak *malloc_or_die(unsigned int size) 88 - { 89 - void *data; 90 - 91 - data = malloc(size); 92 - if (!data) 93 - die("malloc"); 94 - return data; 95 119 }
+1 -1
tools/lib/traceevent/plugin_cfg80211.c
··· 8 8 process___le16_to_cpup(struct trace_seq *s, 9 9 unsigned long long *args) 10 10 { 11 - uint16_t *val = (uint16_t *) args[0]; 11 + uint16_t *val = (uint16_t *) (unsigned long) args[0]; 12 12 return val ? (long long) le16toh(*val) : 0; 13 13 } 14 14
+1 -1
tools/lib/traceevent/plugin_function.c
··· 144 144 return 0; 145 145 } 146 146 147 - void PEVENT_PLUGIN_UNLOADER(void) 147 + void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) 148 148 { 149 149 int i, x; 150 150
+1 -1
tools/lib/traceevent/plugin_scsi.c
··· 405 405 unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s, 406 406 unsigned long long *args) 407 407 { 408 - scsi_trace_parse_cdb(s, (unsigned char *) args[1], args[2]); 408 + scsi_trace_parse_cdb(s, (unsigned char *) (unsigned long) args[1], args[2]); 409 409 return 0; 410 410 } 411 411
+52 -15
tools/lib/traceevent/trace-seq.c
··· 22 22 #include <string.h> 23 23 #include <stdarg.h> 24 24 25 + #include <asm/bug.h> 25 26 #include "event-parse.h" 26 27 #include "event-utils.h" 27 28 ··· 33 32 #define TRACE_SEQ_POISON ((void *)0xdeadbeef) 34 33 #define TRACE_SEQ_CHECK(s) \ 35 34 do { \ 36 - if ((s)->buffer == TRACE_SEQ_POISON) \ 37 - die("Usage of trace_seq after it was destroyed"); \ 35 + if (WARN_ONCE((s)->buffer == TRACE_SEQ_POISON, \ 36 + "Usage of trace_seq after it was destroyed")) \ 37 + (s)->state = TRACE_SEQ__BUFFER_POISONED; \ 38 38 } while (0) 39 + 40 + #define TRACE_SEQ_CHECK_RET_N(s, n) \ 41 + do { \ 42 + TRACE_SEQ_CHECK(s); \ 43 + if ((s)->state != TRACE_SEQ__GOOD) \ 44 + return n; \ 45 + } while (0) 46 + 47 + #define TRACE_SEQ_CHECK_RET(s) TRACE_SEQ_CHECK_RET_N(s, ) 48 + #define TRACE_SEQ_CHECK_RET0(s) TRACE_SEQ_CHECK_RET_N(s, 0) 39 49 40 50 /** 41 51 * trace_seq_init - initialize the trace_seq structure ··· 57 45 s->len = 0; 58 46 s->readpos = 0; 59 47 s->buffer_size = TRACE_SEQ_BUF_SIZE; 60 - s->buffer = malloc_or_die(s->buffer_size); 48 + s->buffer = malloc(s->buffer_size); 49 + if (s->buffer != NULL) 50 + s->state = TRACE_SEQ__GOOD; 51 + else 52 + s->state = TRACE_SEQ__MEM_ALLOC_FAILED; 61 53 } 62 54 63 55 /** ··· 87 71 { 88 72 if (!s) 89 73 return; 90 - TRACE_SEQ_CHECK(s); 74 + TRACE_SEQ_CHECK_RET(s); 91 75 free(s->buffer); 92 76 s->buffer = TRACE_SEQ_POISON; 93 77 } 94 78 95 79 static void expand_buffer(struct trace_seq *s) 96 80 { 81 + char *buf; 82 + 83 + buf = realloc(s->buffer, s->buffer_size + TRACE_SEQ_BUF_SIZE); 84 + if (WARN_ONCE(!buf, "Can't allocate trace_seq buffer memory")) { 85 + s->state = TRACE_SEQ__MEM_ALLOC_FAILED; 86 + return; 87 + } 88 + 89 + s->buffer = buf; 97 90 s->buffer_size += TRACE_SEQ_BUF_SIZE; 98 - s->buffer = realloc(s->buffer, s->buffer_size); 99 - if (!s->buffer) 100 - die("Can't allocate trace_seq buffer memory"); 101 91 } 102 92 103 93 /** ··· 127 105 int len; 128 106 int ret; 129 107 130 - TRACE_SEQ_CHECK(s); 131 - 132 108 try_again: 109 + TRACE_SEQ_CHECK_RET0(s); 110 + 133 111 len = (s->buffer_size - 1) - s->len; 134 112 135 113 va_start(ap, fmt); ··· 163 141 int len; 164 142 int ret; 165 143 166 - TRACE_SEQ_CHECK(s); 167 - 168 144 try_again: 145 + TRACE_SEQ_CHECK_RET0(s); 146 + 169 147 len = (s->buffer_size - 1) - s->len; 170 148 171 149 ret = vsnprintf(s->buffer + s->len, len, fmt, args); ··· 194 172 { 195 173 int len; 196 174 197 - TRACE_SEQ_CHECK(s); 175 + TRACE_SEQ_CHECK_RET0(s); 198 176 199 177 len = strlen(str); 200 178 201 179 while (len > ((s->buffer_size - 1) - s->len)) 202 180 expand_buffer(s); 181 + 182 + TRACE_SEQ_CHECK_RET0(s); 203 183 204 184 memcpy(s->buffer + s->len, str, len); 205 185 s->len += len; ··· 211 187 212 188 int trace_seq_putc(struct trace_seq *s, unsigned char c) 213 189 { 214 - TRACE_SEQ_CHECK(s); 190 + TRACE_SEQ_CHECK_RET0(s); 215 191 216 192 while (s->len >= (s->buffer_size - 1)) 217 193 expand_buffer(s); 194 + 195 + TRACE_SEQ_CHECK_RET0(s); 218 196 219 197 s->buffer[s->len++] = c; 220 198 ··· 225 199 226 200 void trace_seq_terminate(struct trace_seq *s) 227 201 { 228 - TRACE_SEQ_CHECK(s); 202 + TRACE_SEQ_CHECK_RET(s); 229 203 230 204 /* There's always one character left on the buffer */ 231 205 s->buffer[s->len] = 0; ··· 234 208 int trace_seq_do_printf(struct trace_seq *s) 235 209 { 236 210 TRACE_SEQ_CHECK(s); 237 - return printf("%.*s", s->len, s->buffer); 211 + 212 + switch (s->state) { 213 + case TRACE_SEQ__GOOD: 214 + return printf("%.*s", s->len, s->buffer); 215 + case TRACE_SEQ__BUFFER_POISONED: 216 + puts("Usage of trace_seq after it was destroyed"); 217 + break; 218 + case TRACE_SEQ__MEM_ALLOC_FAILED: 219 + puts("Can't allocate trace_seq buffer memory"); 220 + break; 221 + } 222 + return -1; 238 223 }
+3 -3
tools/perf/Documentation/perf-record.txt
··· 68 68 --realtime=:: 69 69 Collect data with this RT SCHED_FIFO priority. 70 70 71 - -D:: 72 - --no-delay:: 71 + --no-buffering:: 73 72 Collect data without buffering. 74 73 75 74 -c:: ··· 208 209 inheritance is automatically disabled. --per-thread is ignored with a warning 209 210 if combined with -a or -C options. 210 211 211 - --initial-delay msecs:: 212 + -D:: 213 + --delay=:: 212 214 After starting the program, wait msecs before measuring. This is useful to 213 215 filter out the startup phase of the program, which is often very different. 214 216
+1
tools/perf/Makefile.perf
··· 76 76 77 77 CC = $(CROSS_COMPILE)gcc 78 78 AR = $(CROSS_COMPILE)ar 79 + PKG_CONFIG = $(CROSS_COMPILE)pkg-config 79 80 80 81 RM = rm -f 81 82 LN = ln -f
+2 -2
tools/perf/builtin-record.c
··· 838 838 "record events on existing thread id"), 839 839 OPT_INTEGER('r', "realtime", &record.realtime_prio, 840 840 "collect data with this RT SCHED_FIFO priority"), 841 - OPT_BOOLEAN('D', "no-delay", &record.opts.no_delay, 841 + OPT_BOOLEAN(0, "no-buffering", &record.opts.no_buffering, 842 842 "collect data without buffering"), 843 843 OPT_BOOLEAN('R', "raw-samples", &record.opts.raw_samples, 844 844 "collect raw sample records from all opened counters"), ··· 882 882 OPT_CALLBACK('G', "cgroup", &record.evlist, "name", 883 883 "monitor event in cgroup name only", 884 884 parse_cgroups), 885 - OPT_UINTEGER(0, "initial-delay", &record.opts.initial_delay, 885 + OPT_UINTEGER('D', "delay", &record.opts.initial_delay, 886 886 "ms to wait before starting measurement after program start"), 887 887 OPT_STRING('u', "uid", &record.opts.target.uid_str, "user", 888 888 "user to profile"),
+3 -21
tools/perf/builtin-report.c
··· 75 75 return perf_default_config(var, value, cb); 76 76 } 77 77 78 - static int report__resolve_callchain(struct report *rep, struct symbol **parent, 79 - struct perf_evsel *evsel, struct addr_location *al, 80 - struct perf_sample *sample) 81 - { 82 - if ((sort__has_parent || symbol_conf.use_callchain) && sample->callchain) { 83 - return machine__resolve_callchain(al->machine, evsel, al->thread, sample, 84 - parent, al, rep->max_stack); 85 - } 86 - return 0; 87 - } 88 - 89 - static int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample *sample) 90 - { 91 - if (!symbol_conf.use_callchain) 92 - return 0; 93 - return callchain_append(he->callchain, &callchain_cursor, sample->period); 94 - } 95 - 96 78 static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_location *al, 97 79 struct perf_sample *sample, struct perf_evsel *evsel, 98 80 union perf_event *event) ··· 85 103 struct hist_entry *he; 86 104 struct mem_info *mi, *mx; 87 105 uint64_t cost; 88 - int err = report__resolve_callchain(rep, &parent, evsel, al, sample); 106 + int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack); 89 107 90 108 if (err) 91 109 return err; ··· 137 155 unsigned i; 138 156 struct hist_entry *he; 139 157 struct branch_info *bi, *bx; 140 - int err = report__resolve_callchain(rep, &parent, evsel, al, sample); 158 + int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack); 141 159 142 160 if (err) 143 161 return err; ··· 190 208 struct report *rep = container_of(tool, struct report, tool); 191 209 struct symbol *parent = NULL; 192 210 struct hist_entry *he; 193 - int err = report__resolve_callchain(rep, &parent, evsel, al, sample); 211 + int err = sample__resolve_callchain(sample, &parent, evsel, al, rep->max_stack); 194 212 195 213 if (err) 196 214 return err;
+7 -15
tools/perf/builtin-top.c
··· 743 743 if (al.sym == NULL || !al.sym->ignore) { 744 744 struct hist_entry *he; 745 745 746 - if ((sort__has_parent || symbol_conf.use_callchain) && 747 - sample->callchain) { 748 - err = machine__resolve_callchain(machine, evsel, 749 - al.thread, sample, 750 - &parent, &al, 751 - top->max_stack); 752 - if (err) 753 - return; 754 - } 746 + err = sample__resolve_callchain(sample, &parent, evsel, &al, 747 + top->max_stack); 748 + if (err) 749 + return; 755 750 756 751 he = perf_evsel__add_hist_entry(evsel, &al, sample); 757 752 if (he == NULL) { ··· 754 759 return; 755 760 } 756 761 757 - if (symbol_conf.use_callchain) { 758 - err = callchain_append(he->callchain, &callchain_cursor, 759 - sample->period); 760 - if (err) 761 - return; 762 - } 762 + err = hist_entry__append_callchain(he, sample); 763 + if (err) 764 + return; 763 765 764 766 if (sort__has_sym) 765 767 perf_top__record_precise_ip(top, he, evsel->idx, ip);
+1 -1
tools/perf/builtin-trace.c
··· 2258 2258 }, 2259 2259 .user_freq = UINT_MAX, 2260 2260 .user_interval = ULLONG_MAX, 2261 - .no_delay = true, 2261 + .no_buffering = true, 2262 2262 .mmap_pages = 1024, 2263 2263 }, 2264 2264 .output = stdout,
+3 -3
tools/perf/config/Makefile
··· 372 372 endif 373 373 374 374 ifndef NO_GTK2 375 - FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) 375 + FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) 376 376 ifneq ($(feature-gtk2), 1) 377 377 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); 378 378 NO_GTK2 := 1 ··· 381 381 GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT 382 382 endif 383 383 CFLAGS += -DHAVE_GTK2_SUPPORT 384 - GTK_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) 385 - GTK_LIBS := $(shell pkg-config --libs gtk+-2.0 2>/dev/null) 384 + GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null) 385 + GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null) 386 386 EXTLIBS += -ldl 387 387 endif 388 388 endif
+5 -4
tools/perf/config/feature-checks/Makefile
··· 28 28 test-stackprotector-all.bin \ 29 29 test-timerfd.bin 30 30 31 - CC := $(CC) -MD 31 + CC := $(CROSS_COMPILE)gcc -MD 32 + PKG_CONFIG := $(CROSS_COMPILE)pkg-config 32 33 33 34 all: $(FILES) 34 35 ··· 38 37 ############################### 39 38 40 39 test-all.bin: 41 - $(BUILD) -Werror -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl 40 + $(BUILD) -Werror -fstack-protector-all -O2 -Werror -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl 42 41 43 42 test-hello.bin: 44 43 $(BUILD) ··· 83 82 $(BUILD) -I/usr/include/slang -lslang 84 83 85 84 test-gtk2.bin: 86 - $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) 85 + $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) 87 86 88 87 test-gtk2-infobar.bin: 89 - $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) 88 + $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) 90 89 91 90 grep-libs = $(filter -l%,$(1)) 92 91 strip-libs = $(filter-out -l%,$(1))
+1 -1
tools/perf/perf.h
··· 252 252 int call_graph; 253 253 bool group; 254 254 bool inherit_stat; 255 - bool no_delay; 255 + bool no_buffering; 256 256 bool no_inherit; 257 257 bool no_inherit_set; 258 258 bool no_samples;
+4 -4
tools/perf/tests/open-syscall-tp-fields.c
··· 11 11 .uid = UINT_MAX, 12 12 .uses_mmap = true, 13 13 }, 14 - .no_delay = true, 15 - .freq = 1, 16 - .mmap_pages = 256, 17 - .raw_samples = true, 14 + .no_buffering = true, 15 + .freq = 1, 16 + .mmap_pages = 256, 17 + .raw_samples = true, 18 18 }; 19 19 const char *filename = "/etc/passwd"; 20 20 int flags = O_RDONLY | O_DIRECTORY;
+3 -3
tools/perf/tests/perf-record.c
··· 39 39 .uid = UINT_MAX, 40 40 .uses_mmap = true, 41 41 }, 42 - .no_delay = true, 43 - .freq = 10, 44 - .mmap_pages = 256, 42 + .no_buffering = true, 43 + .freq = 10, 44 + .mmap_pages = 256, 45 45 }; 46 46 cpu_set_t cpu_mask; 47 47 size_t cpu_mask_size = sizeof(cpu_mask);
+23
tools/perf/util/callchain.c
··· 17 17 18 18 #include "hist.h" 19 19 #include "util.h" 20 + #include "sort.h" 21 + #include "machine.h" 20 22 #include "callchain.h" 21 23 22 24 __thread struct callchain_cursor callchain_cursor; ··· 532 530 cursor->last = &node->next; 533 531 534 532 return 0; 533 + } 534 + 535 + int sample__resolve_callchain(struct perf_sample *sample, struct symbol **parent, 536 + struct perf_evsel *evsel, struct addr_location *al, 537 + int max_stack) 538 + { 539 + if (sample->callchain == NULL) 540 + return 0; 541 + 542 + if (symbol_conf.use_callchain || sort__has_parent) { 543 + return machine__resolve_callchain(al->machine, evsel, al->thread, 544 + sample, parent, al, max_stack); 545 + } 546 + return 0; 547 + } 548 + 549 + int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample *sample) 550 + { 551 + if (!symbol_conf.use_callchain) 552 + return 0; 553 + return callchain_append(he->callchain, &callchain_cursor, sample->period); 535 554 }
+6
tools/perf/util/callchain.h
··· 145 145 } 146 146 147 147 struct option; 148 + struct hist_entry; 148 149 149 150 int record_parse_callchain(const char *arg, struct record_opts *opts); 150 151 int record_parse_callchain_opt(const struct option *opt, const char *arg, int unset); 151 152 int record_callchain_opt(const struct option *opt, const char *arg, int unset); 153 + 154 + int sample__resolve_callchain(struct perf_sample *sample, struct symbol **parent, 155 + struct perf_evsel *evsel, struct addr_location *al, 156 + int max_stack); 157 + int hist_entry__append_callchain(struct hist_entry *he, struct perf_sample *sample); 152 158 153 159 extern const char record_callchain_help[]; 154 160 #endif /* __PERF_CALLCHAIN_H */
+1 -1
tools/perf/util/evsel.c
··· 627 627 if (opts->sample_address) 628 628 perf_evsel__set_sample_bit(evsel, DATA_SRC); 629 629 630 - if (opts->no_delay) { 630 + if (opts->no_buffering) { 631 631 attr->watermark = 0; 632 632 attr->wakeup_events = 1; 633 633 }
+11 -11
tools/perf/util/hist.c
··· 181 181 } 182 182 } 183 183 184 - static void hist_entry__add_cpumode_period(struct hist_entry *he, 185 - unsigned int cpumode, u64 period) 184 + static void he_stat__add_cpumode_period(struct he_stat *he_stat, 185 + unsigned int cpumode, u64 period) 186 186 { 187 187 switch (cpumode) { 188 188 case PERF_RECORD_MISC_KERNEL: 189 - he->stat.period_sys += period; 189 + he_stat->period_sys += period; 190 190 break; 191 191 case PERF_RECORD_MISC_USER: 192 - he->stat.period_us += period; 192 + he_stat->period_us += period; 193 193 break; 194 194 case PERF_RECORD_MISC_GUEST_KERNEL: 195 - he->stat.period_guest_sys += period; 195 + he_stat->period_guest_sys += period; 196 196 break; 197 197 case PERF_RECORD_MISC_GUEST_USER: 198 - he->stat.period_guest_us += period; 198 + he_stat->period_guest_us += period; 199 199 break; 200 200 default: 201 201 break; ··· 222 222 dest->weight += src->weight; 223 223 } 224 224 225 - static void hist_entry__decay(struct hist_entry *he) 225 + static void he_stat__decay(struct he_stat *he_stat) 226 226 { 227 - he->stat.period = (he->stat.period * 7) / 8; 228 - he->stat.nr_events = (he->stat.nr_events * 7) / 8; 227 + he_stat->period = (he_stat->period * 7) / 8; 228 + he_stat->nr_events = (he_stat->nr_events * 7) / 8; 229 229 /* XXX need decay for weight too? */ 230 230 } 231 231 ··· 236 236 if (prev_period == 0) 237 237 return true; 238 238 239 - hist_entry__decay(he); 239 + he_stat__decay(&he->stat); 240 240 241 241 if (!he->filtered) 242 242 hists->stats.total_period -= prev_period - he->stat.period; ··· 402 402 rb_link_node(&he->rb_node_in, parent, p); 403 403 rb_insert_color(&he->rb_node_in, hists->entries_in); 404 404 out: 405 - hist_entry__add_cpumode_period(he, al->cpumode, period); 405 + he_stat__add_cpumode_period(&he->stat, al->cpumode, period); 406 406 return he; 407 407 } 408 408
-2
tools/perf/util/machine.c
··· 1314 1314 *root_al = al; 1315 1315 callchain_cursor_reset(&callchain_cursor); 1316 1316 } 1317 - if (!symbol_conf.use_callchain) 1318 - break; 1319 1317 } 1320 1318 1321 1319 err = callchain_cursor_append(&callchain_cursor,
+2 -2
tools/perf/util/srcline.c
··· 129 129 130 130 out: 131 131 if (a2l) { 132 - zfree((void **)&a2l->input); 132 + zfree((char **)&a2l->input); 133 133 free(a2l); 134 134 } 135 135 bfd_close(abfd); ··· 140 140 { 141 141 if (a2l->abfd) 142 142 bfd_close(a2l->abfd); 143 - zfree((void **)&a2l->input); 143 + zfree((char **)&a2l->input); 144 144 zfree(&a2l->syms); 145 145 free(a2l); 146 146 }
+1 -1
tools/perf/util/strlist.c
··· 39 39 static void str_node__delete(struct str_node *snode, bool dupstr) 40 40 { 41 41 if (dupstr) 42 - zfree((void **)&snode->s); 42 + zfree((char **)&snode->s); 43 43 free(snode); 44 44 } 45 45
+1 -1
tools/perf/util/trace-event.c
··· 34 34 35 35 void trace_event__cleanup(struct trace_event *t) 36 36 { 37 + traceevent_unload_plugins(t->plugin_list, t->pevent); 37 38 pevent_free(t->pevent); 38 - traceevent_unload_plugins(t->plugin_list); 39 39 } 40 40 41 41 static struct event_format*