From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
He Kuang <hekuang@huawei.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Namhyung Kim <namhyung@kernel.org>,
Wang Nan <wangnan0@huawei.com>, Zefan Li <lizefan@huawei.com>,
pi3orama@163.com
Subject: [PATCH 08/13] perf tools: Introduce parse_events_terms__purge()
Date: Mon, 15 Feb 2016 18:01:38 -0300 [thread overview]
Message-ID: <1455570103-29211-9-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1455570103-29211-1-git-send-email-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Purges 'struct parse_event_term' entries from a list_head.
Some users need this because they don't allocate space for the list
head, it maybe on the stack or embedded into some other struct.
Next patch will convert users that need just purging and then the
perf_events__free_terms() routine will free the list head as well,
finally being renamed to perf_events_terms__delete().
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: He Kuang <hekuang@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/n/tip-4w3zl4ifcl0ed0j4bu3tckqp@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/parse-events.c | 7 ++++++-
tools/perf/util/parse-events.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 133c8d28f36c..668afdccfcca 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -2068,7 +2068,7 @@ int parse_events_term__clone(struct parse_events_term **new,
term->err_term, term->err_val);
}
-void parse_events__free_terms(struct list_head *terms)
+void parse_events_terms__purge(struct list_head *terms)
{
struct parse_events_term *term, *h;
@@ -2078,6 +2078,11 @@ void parse_events__free_terms(struct list_head *terms)
}
}
+void parse_events__free_terms(struct list_head *terms)
+{
+ parse_events_terms__purge(terms);
+}
+
void parse_events_evlist_error(struct parse_events_evlist *data,
int idx, const char *str)
{
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index f1a6db107241..f90a04ccab39 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -116,6 +116,7 @@ int parse_events_term__sym_hw(struct parse_events_term **term,
int parse_events_term__clone(struct parse_events_term **new,
struct parse_events_term *term);
void parse_events__free_terms(struct list_head *terms);
+void parse_events_terms__purge(struct list_head *terms);
int parse_events__modifier_event(struct list_head *list, char *str, bool add);
int parse_events__modifier_group(struct list_head *list, char *event_mod);
int parse_events_name(struct list_head *list, char *name);
--
2.5.0
next prev parent reply other threads:[~2016-02-15 21:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 21:01 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 01/13] perf config: Add '--system' and '--user' options to select which config file is used Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 02/13] perf symbols: Fix symbols searching for module in buildid-cache Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 03/13] perf build: Add EXTRA_LDFLAGS option to makefile Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 04/13] perf python scripting: Append examples to err msg about audit-libs-python Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 05/13] perf tools: Add comment explaining the repsep_snprintf function Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 06/13] perf hists: Do column alignment on the format iterator Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 07/13] perf tools: Unlink entries from terms list Arnaldo Carvalho de Melo
2016-02-15 21:01 ` Arnaldo Carvalho de Melo [this message]
2016-02-15 21:01 ` [PATCH 09/13] perf tools: Use perf_event_terms__purge() for non-malloced terms Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 10/13] perf tools: Free the terms list_head in parse_events__free_terms() Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 11/13] perf tools: Rename parse_events__free_terms() to parse_events_terms__delete() Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 12/13] perf data: Fix releasing event_class Arnaldo Carvalho de Melo
2016-02-15 21:01 ` [PATCH 13/13] perf tests: Fix build on older systems where 'signal' is reserved Arnaldo Carvalho de Melo
2016-02-16 7:48 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455570103-29211-9-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=ast@kernel.org \
--cc=hekuang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).