Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754876AbZF3KL1 (ORCPT ); Tue, 30 Jun 2009 06:11:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751065AbZF3KLU (ORCPT ); Tue, 30 Jun 2009 06:11:20 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:50979 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750755AbZF3KLT (ORCPT ); Tue, 30 Jun 2009 06:11:19 -0400 Date: Tue, 30 Jun 2009 12:11:05 +0200 From: Ingo Molnar To: Jaswinder Singh Rajput Cc: Thomas Gleixner , Peter Zijlstra , x86 maintainers , LKML Subject: Re: [PATCH -tip] perf_counter: Add Generalized Hardware FPU support for AMD Message-ID: <20090630101105.GF6942@elte.hu> References: <1246267985.3185.3.camel@hpdv5.satnam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1246267985.3185.3.camel@hpdv5.satnam> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3838 Lines: 83 * Jaswinder Singh Rajput wrote: > $./perf stat -e add -e multiply -e fpu-store -e fpu-empty -e fpu-busy -e x87 -e mmx-3dnow -e sse-sse2 -- ls -lR /usr/include/ > /dev/null > > Performance counter stats for 'ls -lR /usr/include/': > > 7335 add ( 2.00x scaled) > 8012 multiply ( 1.99x scaled) > 5229 fpu-store ( 2.00x scaled) > 793097355 fpu-empty ( 2.00x scaled) > 182 fpu-busy ( 2.00x scaled) > 6 x87 ( 2.01x scaled) > 4 mmx-3dnow ( 2.00x scaled) > 8933 sse-sse2 ( 2.00x scaled) > > 0.393548820 seconds time elapsed > > $./perf stat -e add -e multiply -e fpu-store -e fpu-empty -e fpu-busy -e x87 -e mmx-3dnow -e sse-sse2 -- /usr/bin/rhythmbox ~jaswinder/Music/singhiskinng.mp3 > > Performance counter stats for '/usr/bin/rhythmbox /home/jaswinder/Music/singhiskinng.mp3': > > 19583739 add ( 2.01x scaled) > 20856051 multiply ( 2.01x scaled) > 18669503 fpu-store ( 2.00x scaled) > 25100224054 fpu-empty ( 1.99x scaled) > 12540131 fpu-busy ( 1.99x scaled) > 207228 x87 ( 1.99x scaled) > 1768418 mmx-3dnow ( 2.00x scaled) > 42286702 sse-sse2 ( 2.01x scaled) > > 302.698647617 seconds time elapsed > > $./perf stat -e add -e multiply -e fpu-store -e fpu-empty -e fpu-busy -e x87 -e mmx-3dnow -e sse-sse2 -- /usr/bin/vlc ~jaswinder/Videos/Linus_Torvalds_interview_with_Charlie_Rose_Part_1.flv > > Performance counter stats for '/usr/bin/vlc /home/jaswinder/Videos/Linus_Torvalds_interview_with_Charlie_Rose_Part_1.flv': > > 6572682335 add ( 2.00x scaled) > 11131555181 multiply ( 2.00x scaled) > 1317520699 fpu-store ( 2.00x scaled) > 9089415134 fpu-empty ( 1.99x scaled) > 2902772713 fpu-busy ( 2.00x scaled) > 26047 x87 ( 2.00x scaled) > 24850978532 mmx-3dnow ( 2.00x scaled) > 262276117 sse-sse2 ( 2.01x scaled) > > 96.169312358 seconds time elapsed > > Signed-off-by: Jaswinder Singh Rajput > --- > arch/x86/kernel/cpu/perf_counter.c | 34 ++++++++++++++++++++++++++++++ > include/linux/perf_counter.h | 17 +++++++++++++++ > kernel/perf_counter.c | 1 + > tools/perf/util/parse-events.c | 40 ++++++++++++++++++++++++++++++++++++ > 4 files changed, 92 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c > index b83474b..4417edf 100644 > --- a/arch/x86/kernel/cpu/perf_counter.c > +++ b/arch/x86/kernel/cpu/perf_counter.c > @@ -372,6 +372,12 @@ static const u64 atom_hw_cache_event_ids > }, > }; > > +/* > + * Generalized hw fpu event table > + */ > + > +static u64 __read_mostly hw_fpu_event_ids[PERF_COUNT_HW_FPU_MAX]; ok, this looks genuinely useful, but there are some gaps. Where's the divides? Plus things like mmx-3dnow are AMD specific, sse-sse2 is x86 specific. We definitely want this general table, but the events should be truly general. Also, how would this look like on Intel, roughly? Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/