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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Mar 2009 10:20:40 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Paul Mackerras <paulus@...ba.org>
Cc:	a.p.zijlstra@...llo.nl, tglx@...utronix.de, fengguang.wu@...el.com,
	hpa@...or.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf_counter tools: remove glib dependency and fix
	bugs in kerneltop.c


* Paul Mackerras <paulus@...ba.org> wrote:

> The glib dependency in kerneltop.c is only for a little bit of list
> manipulation, and I find it inconvenient.  This adds a 'next' field to
> struct source_line, which lets us link them together into a list.  The
> code to do the linking ourselves turns out to be no longer or more
> difficult than using glib.
> 
> This also fixes a few other problems:
> 
> - We need to #include <limits.h> to get PATH_MAX on powerpc.
> 
> - We need to #include <linux/types.h> rather than have our own
>   definitions of __u64 and __s64; on powerpc the installed headers
>   define them to be unsigned long and long respectively, and if we
>   have our own, different definition here that causes a compile error.
> 
> - This takes out the x86 setting of errno from -ret in
>   sys_perf_counter_open.  My experiments on x86 indicate that the
>   glibc syscall() does this for us already.
> 
> - We had two CPU migration counters in the default set, which seems
>   unnecessary; I changed one of them to a context switch counter.
> 
> - In perfstat mode we were printing CPU cycles and instructions as
>   milliseconds, and the cpu clock and task clock counters as events.
>   This fixes that.
> 
> - In perfstat mode we were still printing a blank line after the first
>   counter, which was a holdover from when a task clock counter was
>   automatically included as the first counter.  This removes the blank
>   line.
> 
> - On a test machine here, parse_symbols() and parse_vmlinux() were
>   taking long enough (almost 0.5 seconds) for the mmap buffer to
>   overflow before we got to the first mmap_read() call, so this moves
>   them before we open all the counters.
> 
> - The error message if sys_perf_counter_open fails needs to use errno,
>   not -fd[i][counter].
> 
> Signed-off-by: Paul Mackerras <paulus@...ba.org>
> 
> ---
>  Documentation/perf_counter/Makefile    |    2 +-
>  Documentation/perf_counter/kerneltop.c |  112 +++++++++++++-------------------
>  2 files changed, 46 insertions(+), 68 deletions(-)

Very nice, thanks Paul!

	Ingo
--
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