From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754954AbbCLPMc (ORCPT ); Thu, 12 Mar 2015 11:12:32 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:40968 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754582AbbCLPMb (ORCPT ); Thu, 12 Mar 2015 11:12:31 -0400 Date: Fri, 13 Mar 2015 00:11:47 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , David Ahern , Minchan Kim , Joonsoo Kim Subject: Re: [PATCH 4/6] perf kmem: Analyze page allocator events also Message-ID: <20150312151147.GB1398@danjae> References: <1426145571-3065-1-git-send-email-namhyung@kernel.org> <1426145571-3065-5-git-send-email-namhyung@kernel.org> <20150312110127.GD8369@krava.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150312110127.GD8369@krava.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On Thu, Mar 12, 2015 at 12:01:27PM +0100, Jiri Olsa wrote: > On Thu, Mar 12, 2015 at 04:32:49PM +0900, Namhyung Kim wrote: > > SNIP > > > +static int parse_slab_opt(const struct option *opt __maybe_unused, > > + const char *arg __maybe_unused, > > + int unset __maybe_unused) > > +{ > > + kmem_slab = (kmem_page + 1); > > + return 0; > > +} > > + > > +static int parse_page_opt(const struct option *opt __maybe_unused, > > + const char *arg __maybe_unused, > > + int unset __maybe_unused) > > +{ > > + kmem_page = (kmem_slab + 1); > > + return 0; > > +} > > hum, just curious.. why not just assign 1, I'm missing the magic ;-) Well, basically I just followed the existing convention. :) Anyway it controls the effect of -s/--sort option. The single -s option will be used to set sort keys for both of --alloc and --caller stat. So it needs to known currently selected mode at option parsing time. I extended it to page/slab selection also. For example, # perf kmem --page --alloc -s bytes --slab --caller -s hit The first -s option will set sort keys for page/alloc stat and the second -s option will set sort keys for slab/caller stat. So the -s option should be preceded by at least one of the mode selection options (i.e. --page/slab/alloc/caller). I'll add it to the man page also. Thanks, Namhyung