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-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf: x86: Add support for the ANY bit
perf: Change the is_software_event() definition
perf: Honour event state for aux stream data
perf: Fix perf_event_do_pending() fallback callsite
perf kmem: Print usage help for unknown commands
perf kmem: Increase "Hit" column length
hw-breakpoints, perf: Fix broken mmiotrace due to dr6 by reference change
perf timechart: Use tid not pid for COMM change

+35 -12
+1
arch/x86/include/asm/perf_event.h
··· 19 19 #define MSR_ARCH_PERFMON_EVENTSEL1 0x187 20 20 21 21 #define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) 22 + #define ARCH_PERFMON_EVENTSEL_ANY (1 << 21) 22 23 #define ARCH_PERFMON_EVENTSEL_INT (1 << 20) 23 24 #define ARCH_PERFMON_EVENTSEL_OS (1 << 17) 24 25 #define ARCH_PERFMON_EVENTSEL_USR (1 << 16)
+7
arch/x86/kernel/cpu/perf_event.c
··· 1343 1343 bits |= 0x2; 1344 1344 if (hwc->config & ARCH_PERFMON_EVENTSEL_OS) 1345 1345 bits |= 0x1; 1346 + 1347 + /* 1348 + * ANY bit is supported in v3 and up 1349 + */ 1350 + if (x86_pmu.version > 2 && hwc->config & ARCH_PERFMON_EVENTSEL_ANY) 1351 + bits |= 0x4; 1352 + 1346 1353 bits <<= (idx * 4); 1347 1354 mask = 0xfULL << (idx * 4); 1348 1355
+4 -3
arch/x86/mm/kmmio.c
··· 538 538 kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args) 539 539 { 540 540 struct die_args *arg = args; 541 + unsigned long* dr6_p = (unsigned long *)ERR_PTR(arg->err); 541 542 542 - if (val == DIE_DEBUG && (arg->err & DR_STEP)) 543 - if (post_kmmio_handler(arg->err, arg->regs) == 1) { 543 + if (val == DIE_DEBUG && (*dr6_p & DR_STEP)) 544 + if (post_kmmio_handler(*dr6_p, arg->regs) == 1) { 544 545 /* 545 546 * Reset the BS bit in dr6 (pointed by args->err) to 546 547 * denote completion of processing 547 548 */ 548 - (*(unsigned long *)ERR_PTR(arg->err)) &= ~DR_STEP; 549 + *dr6_p &= ~DR_STEP; 549 550 return NOTIFY_STOP; 550 551 } 551 552
+8 -3
include/linux/perf_event.h
··· 814 814 */ 815 815 static inline int is_software_event(struct perf_event *event) 816 816 { 817 - return (event->attr.type != PERF_TYPE_RAW) && 818 - (event->attr.type != PERF_TYPE_HARDWARE) && 819 - (event->attr.type != PERF_TYPE_HW_CACHE); 817 + switch (event->attr.type) { 818 + case PERF_TYPE_SOFTWARE: 819 + case PERF_TYPE_TRACEPOINT: 820 + /* for now the breakpoint stuff also works as software event */ 821 + case PERF_TYPE_BREAKPOINT: 822 + return 1; 823 + } 824 + return 0; 820 825 } 821 826 822 827 extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX];
+9
kernel/perf_event.c
··· 3268 3268 3269 3269 static int perf_event_task_match(struct perf_event *event) 3270 3270 { 3271 + if (event->state != PERF_EVENT_STATE_ACTIVE) 3272 + return 0; 3273 + 3271 3274 if (event->cpu != -1 && event->cpu != smp_processor_id()) 3272 3275 return 0; 3273 3276 ··· 3380 3377 3381 3378 static int perf_event_comm_match(struct perf_event *event) 3382 3379 { 3380 + if (event->state != PERF_EVENT_STATE_ACTIVE) 3381 + return 0; 3382 + 3383 3383 if (event->cpu != -1 && event->cpu != smp_processor_id()) 3384 3384 return 0; 3385 3385 ··· 3500 3494 static int perf_event_mmap_match(struct perf_event *event, 3501 3495 struct perf_mmap_event *mmap_event) 3502 3496 { 3497 + if (event->state != PERF_EVENT_STATE_ACTIVE) 3498 + return 0; 3499 + 3503 3500 if (event->cpu != -1 && event->cpu != smp_processor_id()) 3504 3501 return 0; 3505 3502
+1 -2
kernel/timer.c
··· 1198 1198 run_local_timers(); 1199 1199 rcu_check_callbacks(cpu, user_tick); 1200 1200 printk_tick(); 1201 + perf_event_do_pending(); 1201 1202 scheduler_tick(); 1202 1203 run_posix_cpu_timers(p); 1203 1204 } ··· 1209 1208 static void run_timer_softirq(struct softirq_action *h) 1210 1209 { 1211 1210 struct tvec_base *base = __get_cpu_var(tvec_bases); 1212 - 1213 - perf_event_do_pending(); 1214 1211 1215 1212 hrtimer_run_pending(); 1216 1213
+4 -3
tools/perf/builtin-kmem.c
··· 375 375 376 376 printf("%.102s\n", graph_dotted_line); 377 377 printf(" %-34s |", is_caller ? "Callsite": "Alloc Ptr"); 378 - printf(" Total_alloc/Per | Total_req/Per | Hit | Ping-pong | Frag\n"); 378 + printf(" Total_alloc/Per | Total_req/Per | Hit | Ping-pong | Frag\n"); 379 379 printf("%.102s\n", graph_dotted_line); 380 380 381 381 next = rb_first(root); ··· 401 401 snprintf(buf, sizeof(buf), "%#Lx", addr); 402 402 printf(" %-34s |", buf); 403 403 404 - printf(" %9llu/%-5lu | %9llu/%-5lu | %6lu | %8lu | %6.3f%%\n", 404 + printf(" %9llu/%-5lu | %9llu/%-5lu | %8lu | %8lu | %6.3f%%\n", 405 405 (unsigned long long)data->bytes_alloc, 406 406 (unsigned long)data->bytes_alloc / data->hit, 407 407 (unsigned long long)data->bytes_req, ··· 784 784 setup_sorting(&alloc_sort, default_sort_order); 785 785 786 786 return __cmd_kmem(); 787 - } 787 + } else 788 + usage_with_options(kmem_usage, kmem_options); 788 789 789 790 return 0; 790 791 }
+1 -1
tools/perf/builtin-timechart.c
··· 280 280 281 281 static int process_comm_event(event_t *event, struct perf_session *session __used) 282 282 { 283 - pid_set_comm(event->comm.pid, event->comm.comm); 283 + pid_set_comm(event->comm.tid, event->comm.comm); 284 284 return 0; 285 285 } 286 286