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, 29 Nov 2012 16:44:59 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	linux-kernel@...r.kernel.org,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 01/14] perf tool: Introduce perf_hpp__list for period related columns

Hi Jiri,

On Wed, 28 Nov 2012 14:52:36 +0100, Jiri Olsa wrote:
> Adding perf_hpp__list list to register and contain all period
> related columns the command is interested in.
>
> This way we get rid of static array holding all possible
> columns and enable commands to register their own columns.

But it seems you didn't get rid of the array? :)

>
> It'll be handy for diff command in future to process and display
> data for multiple files.
[snip]
> diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
> index 8b091a5..a935a60 100644
> --- a/tools/perf/util/hist.h
> +++ b/tools/perf/util/hist.h
> @@ -126,13 +126,19 @@ struct perf_hpp {
>  };
>  
>  struct perf_hpp_fmt {
> -	bool cond;
>  	int (*header)(struct perf_hpp *hpp);
>  	int (*width)(struct perf_hpp *hpp);
>  	int (*color)(struct perf_hpp *hpp, struct hist_entry *he);
>  	int (*entry)(struct perf_hpp *hpp, struct hist_entry *he);
> +
> +	struct list_head list;
>  };
>  
> +extern struct list_head perf_hpp__list;
> +
> +#define perf_hpp__for_each_format(format) \
> +	list_for_each_entry(format, &perf_hpp__list, list)
> +
>  extern struct perf_hpp_fmt perf_hpp__format[];

Instead of using new perf_hpp__list, how about this?

#define perf_hpp__for_each_format(fmt) \
        for (fmt = &perf_hpp__format[0]; fmt < &perf_hpp__format[PERF_HPP__MAX_INDEX]; fmt++) \
                if (fmt->cond)

Thanks,
Namhyung

>  
>  enum {
> @@ -155,7 +161,8 @@ enum {
>  };
>  
>  void perf_hpp__init(void);
> -void perf_hpp__column_enable(unsigned col, bool enable);
> +void perf_hpp__column_register(struct perf_hpp_fmt *format);
> +void perf_hpp__column_enable(unsigned col);
>  int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
>  				bool color);
--
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