lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Jun 2010 19:50:10 -0300
From:	Arnaldo Carvalho de Melo <acme@...hat.com>
To:	Chase Douglas <chase.douglas@...onical.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Clark Williams <williams@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [RESEND][PATCH v2] perf probe: add kernel source path option

Corrected Masami-san address,

Em Mon, Jun 14, 2010 at 03:26:30PM -0400, Chase Douglas escreveu:
> The probe plugin requires access to the source code for some operations.
> The source code must be in the exact same location as specified by the
> DWARF tags, but sometimes the location is an absolute path that cannot
> be replicated by a normal user. This change adds the -s|--source option
> to allow the user to specify the root of the kernel source tree.
> 
> Signed-off-by: Chase Douglas <chase.douglas@...onical.com>

Just tested it, works as advertised:

[root@...lia mingo]# perf probe -L __schedule | head -22
Debuginfo analysis failed. (-2)
  Error: Failed to show lines. (-2)
[root@...lia mingo]# perf probe -s /usr/src/debug/kernel-rt-2.6.33.4-rt20.19.el5rt/linux-2.6.33.4.x86_64 -L __schedule | head -22
<__schedule:0>
      0  {
         	struct task_struct *prev, *next;
         	unsigned long *switch_count;
         	struct rq *rq;
         	int cpu;
         
      6  	cpu = smp_processor_id();
      7  	rq = cpu_rq(cpu);
      8  	rcu_sched_qs(cpu);
      9  	prev = rq->curr;
     10  	switch_count = &prev->nivcsw;
         
     12  	release_kernel_lock(prev);
         
         	schedule_debug(prev);
         
     16  	preempt_disable();
         
     18  	if (sched_feat(HRTICK))
     19  		hrtick_clear(rq);
         
[root@...lia mingo]# cat /sys/kernel/debug/sched_features
FAIR_SLEEPERS GENTLE_FAIR_SLEEPERS NO_NORMALIZED_SLEEPER START_DEBIT WAKEUP_PREEMPT ADAPTIVE_GRAN ASYM_GRAN NO_WAKEUP_SYNC NO_WAKEUP_OVERLAP SYNC_WAKEUPS AFFINE_WAKEUPS SYNC_LESS NO_SYNC_MORE NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY NO_ARCH_POWER NO_HRTICK NO_DOUBLE_TICK LB_BIAS LB_SHARES_UPDATE ASYM_EFF_LOAD OWNER_SPIN 
[root@...lia mingo]# perf probe __schedule:19
Add new event:
  probe:__schedule     (on __schedule:19)

You can now use it on all perf tools, such as:

	perf record -e probe:__schedule -aR sleep 1

[root@...lia mingo]# perf record -e probe:__schedule -aR sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.061 MB perf.data (~2684 samples) ]
[root@...lia mingo]# perf report | head -15
#
# (For a higher level overview, try: perf report --sort comm,dso)
#
[root@...lia mingo]# echo HRTICK > /sys/kernel/debug/sched_features
[root@...lia mingo]# cat /sys/kernel/debug/sched_features
FAIR_SLEEPERS GENTLE_FAIR_SLEEPERS NO_NORMALIZED_SLEEPER START_DEBIT WAKEUP_PREEMPT ADAPTIVE_GRAN ASYM_GRAN NO_WAKEUP_SYNC NO_WAKEUP_OVERLAP SYNC_WAKEUPS AFFINE_WAKEUPS SYNC_LESS NO_SYNC_MORE NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY NO_ARCH_POWER HRTICK NO_DOUBLE_TICK LB_BIAS LB_SHARES_UPDATE ASYM_EFF_LOAD OWNER_SPIN 
[root@...lia mingo]# perf record -e probe:__schedule -aR sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.528 MB perf.data (~66766 samples) ]
[root@...lia mingo]# perf report | head -15
# Events: 19K cycles
#
# Overhead          Command       Shared Object  Symbol
# ........  ...............  ..................  ......
#
    38.42%             init                   0  [k] 0000000000000000
     5.42%     sirq-timer/0  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/5  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/4  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/3  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/2  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/1  [kernel.kallsyms]   [k] kernel_thread_helper
     5.40%     sirq-timer/7  [kernel.kallsyms]   [k] kernel_thread_helper
     5.40%     sirq-timer/6  [kernel.kallsyms]   [k] kernel_thread_helper
     5.26%          swapper                   0  [k] 0000000000000000
[root@...lia mingo]#

Really cool stuff, thanks for your patch and to Masami for his amazing work on
'perf probe'.

I think we should look at usual places like debuginfo packages and
/usr/src/linux-`uname`, ~/git/linux-2.6/, etc, but that is something for a
follow on patch.

Best Regards,

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ