mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Move nr_entries count from 'struct perf' to into perf_evlist struct. Committer notes: Fix tools/perf/arch/s390/util/auxtrace.c case. And also the comment in tools/perf/util/annotate.h. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20190721112506.12306-42-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
25 lines
565 B
C
25 lines
565 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <perf/evlist.h>
|
|
#include <linux/list.h>
|
|
#include <internal/evlist.h>
|
|
#include <internal/evsel.h>
|
|
|
|
void perf_evlist__init(struct perf_evlist *evlist)
|
|
{
|
|
INIT_LIST_HEAD(&evlist->entries);
|
|
evlist->nr_entries = 0;
|
|
}
|
|
|
|
void perf_evlist__add(struct perf_evlist *evlist,
|
|
struct perf_evsel *evsel)
|
|
{
|
|
list_add_tail(&evsel->node, &evlist->entries);
|
|
evlist->nr_entries += 1;
|
|
}
|
|
|
|
void perf_evlist__remove(struct perf_evlist *evlist,
|
|
struct perf_evsel *evsel)
|
|
{
|
|
list_del_init(&evsel->node);
|
|
evlist->nr_entries -= 1;
|
|
}
|