lkml.org 
[lkml]   [2020]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 1/2] perf parse: Refactor struct perf_evsel_config_term
On Mon, Jan 13, 2020 at 11:18:05PM +0800, Leo Yan wrote:
> The struct perf_evsel_config_term::val is a union which contains
> fields 'callgraph', 'drv_cfg' and 'branch' as string pointers. This
> leads to the complex code logic for handling every type's string
> separately, and it's hard to release string as a general way.
>
> This patch refactors the structure to add a common field 'str' in the
> 'val' union as string pointer and remove the other three fields
> 'callgraph', 'drv_cfg' and 'branch'. Without passing field name, the
> patch simplifies the string handling with macro ADD_CONFIG_TERM_STR()
> for string pointer assignment.

Looks like a good cleanup.

Reviewed-by: Andi Kleen <ak@linux.intel.com>

-Andi

\
 
 \ /
  Last update: 2020-01-13 19:45    [W:0.076 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site