public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Paul Mackerras <paulus@samba.org>
Cc: a.p.zijlstra@chello.nl, tglx@linutronix.de,
	fengguang.wu@intel.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf_counter tools: remove glib dependency and fix bugs in kerneltop.c
Date: Tue, 24 Mar 2009 10:20:40 +0100	[thread overview]
Message-ID: <20090324092040.GC6605@elte.hu> (raw)
In-Reply-To: <18888.29986.340328.540512@cargo.ozlabs.ibm.com>


* Paul Mackerras <paulus@samba.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@samba.org>
> 
> ---
>  Documentation/perf_counter/Makefile    |    2 +-
>  Documentation/perf_counter/kerneltop.c |  112 +++++++++++++-------------------
>  2 files changed, 46 insertions(+), 68 deletions(-)

Very nice, thanks Paul!

	Ingo

  parent reply	other threads:[~2009-03-24  9:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24  5:52 [PATCH] perf_counter tools: remove glib dependency and fix bugs in kerneltop.c Paul Mackerras
2009-03-24  7:57 ` Peter Zijlstra
2009-03-24  9:20 ` Ingo Molnar [this message]
2009-03-24  9:36 ` [tip:perfcounters/core] " Paul Mackerras
2009-03-24  9:38   ` Ingo Molnar
2009-03-24 10:12     ` Paul Mackerras
2009-03-24 10:14       ` Ingo Molnar
2009-03-24 10:00 ` [tip:perfcounters/core] perf_counter tools: remove glib dependency and fix bugs in kerneltop.c, fix poll() Peter Zijlstra
     [not found] ` <1237875063.7530.11.camel@marge.simson.net>
     [not found]   ` <1237875580.7827.3.camel@marge.simson.net>
     [not found]     ` <1237877884.8754.2.camel@marge.simson.net>
     [not found]       ` <18888.38308.223722.602357@cargo.ozlabs.ibm.com>
     [not found]         ` <1237888224.24918.159.camel@twins>
     [not found]           ` <1237891863.13862.27.camel@marge.simson.net>
     [not found]             ` <1237892368.24918.160.camel@twins>
2009-03-24 12:18               ` [PATCH] perf_counter: fix perf_poll() Peter Zijlstra
2009-03-24 12:21                 ` Peter Zijlstra
2009-03-24 12:25                   ` Ingo Molnar
2009-03-24 13:06                 ` [tip:perfcounters/core] " Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090324092040.GC6605@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fengguang.wu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox