Skip to content
  • Leo Yan's avatar
    perf parse: Refactor 'struct perf_evsel_config_term' · e884602b
    Leo Yan authored
    
    
    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.
    
    This patch fixes multiple warnings of line over 80 characters detected
    by checkpatch tool.
    
    Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
    Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
    Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
    Cc: Mike Leach <mike.leach@linaro.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lore.kernel.org/lkml/20200117055251.24058-1-leo.yan@linaro.org
    
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    e884602b