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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
"Assorted small fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf python: Properly link with libtraceevent
perf hists browser: Add back callchain folding symbol
perf tools: Fix build on sparc.
perf python: Link with libtraceevent
perf python: Initialize 'page_size' variable
tools lib traceevent: Fix missed freeing of subargs in free_arg() in filter
lib tools traceevent: Add back pevent assignment in __pevent_parse_format()
perf hists browser: Fix off-by-two bug on the first column
perf tools: Remove warnings on JIT samples for srcline sort key
perf tools: Fix segfault when using srcline sort key
perf: Require exclude_guest to use PEBS - kernel side enforcement
perf tool: Precise mode requires exclude_guest

+56 -17
+6
arch/x86/kernel/cpu/perf_event.c
··· 338 338 /* BTS is currently only allowed for user-mode. */ 339 339 if (!attr->exclude_kernel) 340 340 return -EOPNOTSUPP; 341 + 342 + if (!attr->exclude_guest) 343 + return -EOPNOTSUPP; 341 344 } 342 345 343 346 hwc->config |= config; ··· 382 379 { 383 380 if (event->attr.precise_ip) { 384 381 int precise = 0; 382 + 383 + if (!event->attr.exclude_guest) 384 + return -EOPNOTSUPP; 385 385 386 386 /* Support for constant skid */ 387 387 if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) {
+6 -3
tools/lib/traceevent/event-parse.c
··· 2602 2602 { 2603 2603 struct pevent_function_handler *func; 2604 2604 2605 + if (!pevent) 2606 + return NULL; 2607 + 2605 2608 for (func = pevent->func_handlers; func; func = func->next) { 2606 2609 if (strcmp(func->name, func_name) == 0) 2607 2610 break; ··· 4941 4938 goto event_alloc_failed; 4942 4939 } 4943 4940 4941 + /* Add pevent to event so that it can be referenced */ 4942 + event->pevent = pevent; 4943 + 4944 4944 ret = event_read_format(event); 4945 4945 if (ret < 0) { 4946 4946 ret = PEVENT_ERRNO__READ_FORMAT_FAILED; ··· 5046 5040 5047 5041 if (event == NULL) 5048 5042 return ret; 5049 - 5050 - /* Add pevent to event so that it can be referenced */ 5051 - event->pevent = pevent; 5052 5043 5053 5044 if (add_event(pevent, event)) { 5054 5045 ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
+15
tools/lib/traceevent/parse-filter.c
··· 209 209 switch (arg->type) { 210 210 case FILTER_ARG_NONE: 211 211 case FILTER_ARG_BOOLEAN: 212 + break; 213 + 212 214 case FILTER_ARG_NUM: 215 + free_arg(arg->num.left); 216 + free_arg(arg->num.right); 217 + break; 218 + 219 + case FILTER_ARG_EXP: 220 + free_arg(arg->exp.left); 221 + free_arg(arg->exp.right); 213 222 break; 214 223 215 224 case FILTER_ARG_STR: 216 225 free(arg->str.val); 217 226 regfree(&arg->str.reg); 218 227 free(arg->str.buffer); 228 + break; 229 + 230 + case FILTER_ARG_VALUE: 231 + if (arg->value.type == FILTER_STRING || 232 + arg->value.type == FILTER_CHAR) 233 + free(arg->value.str); 219 234 break; 220 235 221 236 case FILTER_ARG_OP:
+13 -11
tools/perf/Makefile
··· 184 184 grep-libs = $(filter -l%,$(1)) 185 185 strip-libs = $(filter-out -l%,$(1)) 186 186 187 + TRACE_EVENT_DIR = ../lib/traceevent/ 188 + 189 + ifneq ($(OUTPUT),) 190 + TE_PATH=$(OUTPUT) 191 + else 192 + TE_PATH=$(TRACE_EVENT_DIR) 193 + endif 194 + 195 + LIBTRACEEVENT = $(TE_PATH)libtraceevent.a 196 + TE_LIB := -L$(TE_PATH) -ltraceevent 197 + 187 198 PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) 188 199 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py 200 + 201 + export LIBTRACEEVENT 189 202 190 203 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) 191 204 $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ ··· 210 197 # 211 198 212 199 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) 213 - 214 - TRACE_EVENT_DIR = ../lib/traceevent/ 215 - 216 - ifneq ($(OUTPUT),) 217 - TE_PATH=$(OUTPUT) 218 - else 219 - TE_PATH=$(TRACE_EVENT_DIR) 220 - endif 221 - 222 - LIBTRACEEVENT = $(TE_PATH)libtraceevent.a 223 - TE_LIB := -L$(TE_PATH) -ltraceevent 224 200 225 201 # 226 202 # Single 'perf' binary right now:
+1 -1
tools/perf/perf.h
··· 57 57 #endif 58 58 59 59 #ifdef __sparc__ 60 - #include "../../arch/sparc/include/asm/unistd.h" 60 + #include "../../arch/sparc/include/uapi/asm/unistd.h" 61 61 #define rmb() asm volatile("":::"memory") 62 62 #define cpu_relax() asm volatile("":::"memory") 63 63 #define CPUINFO_PROC "cpu"
+4 -2
tools/perf/ui/browsers/hists.c
··· 610 610 char folded_sign = ' '; 611 611 bool current_entry = ui_browser__is_current_entry(&browser->b, row); 612 612 off_t row_offset = entry->row_offset; 613 + bool first = true; 613 614 614 615 if (current_entry) { 615 616 browser->he_selection = entry; ··· 634 633 if (!perf_hpp__format[i].cond) 635 634 continue; 636 635 637 - if (i) { 636 + if (!first) { 638 637 slsmg_printf(" "); 639 638 width -= 2; 640 639 } 640 + first = false; 641 641 642 642 if (perf_hpp__format[i].color) { 643 643 hpp.ptr = &percent; ··· 647 645 648 646 ui_browser__set_percent_color(&browser->b, percent, current_entry); 649 647 650 - if (i == 0 && symbol_conf.use_callchain) { 648 + if (i == PERF_HPP__OVERHEAD && symbol_conf.use_callchain) { 651 649 slsmg_printf("%c ", folded_sign); 652 650 width -= 2; 653 651 }
+3
tools/perf/util/parse-events.c
··· 690 690 eH = 0; 691 691 } else if (*str == 'p') { 692 692 precise++; 693 + /* use of precise requires exclude_guest */ 694 + if (!exclude_GH) 695 + eG = 1; 693 696 } else 694 697 break; 695 698
+2
tools/perf/util/setup.py
··· 23 23 24 24 build_lib = getenv('PYTHON_EXTBUILD_LIB') 25 25 build_tmp = getenv('PYTHON_EXTBUILD_TMP') 26 + libtraceevent = getenv('LIBTRACEEVENT') 26 27 27 28 ext_sources = [f.strip() for f in file('util/python-ext-sources') 28 29 if len(f.strip()) > 0 and f[0] != '#'] ··· 32 31 sources = ext_sources, 33 32 include_dirs = ['util/include'], 34 33 extra_compile_args = cflags, 34 + extra_objects = [libtraceevent], 35 35 ) 36 36 37 37 setup(name='perf',
+6
tools/perf/util/sort.c
··· 260 260 if (path != NULL) 261 261 goto out_path; 262 262 263 + if (!self->ms.map) 264 + goto out_ip; 265 + 266 + if (!strncmp(self->ms.map->dso->long_name, "/tmp/perf-", 10)) 267 + goto out_ip; 268 + 263 269 snprintf(cmd, sizeof(cmd), "addr2line -e %s %016" PRIx64, 264 270 self->ms.map->dso->long_name, self->ip); 265 271 fp = popen(cmd, "r");