From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jean Pihet <jean.pihet@linaro.org>,
Namhyung Kim <namhyung@kernel.org>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 08/33] perf tools: Rename ordered_events members
Date: Mon, 4 Aug 2014 13:17:19 -0300 [thread overview]
Message-ID: <1407169064-25625-9-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1407169064-25625-1-git-send-email-acme@kernel.org>
From: Jiri Olsa <jolsa@kernel.org>
Rename 'struct ordered_events' members to fit better the ordered events
style.
No functional change was intended.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-v0eb2hsmrxbolnoawu5fn92z@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/session.c | 86 +++++++++++++++++++++++------------------------
tools/perf/util/session.h | 12 +++----
2 files changed, 48 insertions(+), 50 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 6570282a7625..619778ef5b58 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -75,8 +75,8 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
goto out;
session->repipe = repipe;
- INIT_LIST_HEAD(&session->ordered_events.samples);
- INIT_LIST_HEAD(&session->ordered_events.sample_cache);
+ INIT_LIST_HEAD(&session->ordered_events.events);
+ INIT_LIST_HEAD(&session->ordered_events.cache);
INIT_LIST_HEAD(&session->ordered_events.to_free);
machines__init(&session->machines);
@@ -474,11 +474,11 @@ static int ordered_events__flush(struct perf_session *s,
struct perf_tool *tool)
{
struct ordered_events *oe = &s->ordered_events;
- struct list_head *head = &oe->samples;
+ struct list_head *head = &oe->events;
struct ordered_event *tmp, *iter;
struct perf_sample sample;
u64 limit = oe->next_flush;
- u64 last_ts = oe->last_sample ? oe->last_sample->timestamp : 0ULL;
+ u64 last_ts = oe->last ? oe->last->timestamp : 0ULL;
bool show_progress = limit == ULLONG_MAX;
struct ui_progress prog;
int ret;
@@ -487,7 +487,7 @@ static int ordered_events__flush(struct perf_session *s,
return 0;
if (show_progress)
- ui_progress__init(&prog, oe->nr_samples, "Processing time ordered events...");
+ ui_progress__init(&prog, oe->nr_events, "Processing time ordered events...");
list_for_each_entry_safe(iter, tmp, head, list) {
if (session_done())
@@ -508,19 +508,17 @@ static int ordered_events__flush(struct perf_session *s,
oe->last_flush = iter->timestamp;
list_del(&iter->list);
- list_add(&iter->list, &oe->sample_cache);
- oe->nr_samples--;
+ list_add(&iter->list, &oe->cache);
+ oe->nr_events--;
if (show_progress)
ui_progress__update(&prog, 1);
}
- if (list_empty(head)) {
- oe->last_sample = NULL;
- } else if (last_ts <= limit) {
- oe->last_sample =
- list_entry(head->prev, struct ordered_event, list);
- }
+ if (list_empty(head))
+ oe->last = NULL;
+ else if (last_ts <= limit)
+ oe->last = list_entry(head->prev, struct ordered_event, list);
return 0;
}
@@ -579,45 +577,45 @@ static int process_finished_round(struct perf_tool *tool,
static void __queue_event(struct ordered_event *new, struct perf_session *s)
{
struct ordered_events *oe = &s->ordered_events;
- struct ordered_event *sample = oe->last_sample;
+ struct ordered_event *last = oe->last;
u64 timestamp = new->timestamp;
struct list_head *p;
- ++oe->nr_samples;
- oe->last_sample = new;
+ ++oe->nr_events;
+ oe->last = new;
- if (!sample) {
- list_add(&new->list, &oe->samples);
+ if (!last) {
+ list_add(&new->list, &oe->events);
oe->max_timestamp = timestamp;
return;
}
/*
- * last_sample might point to some random place in the list as it's
+ * last event might point to some random place in the list as it's
* the last queued event. We expect that the new event is close to
* this.
*/
- if (sample->timestamp <= timestamp) {
- while (sample->timestamp <= timestamp) {
- p = sample->list.next;
- if (p == &oe->samples) {
- list_add_tail(&new->list, &oe->samples);
+ if (last->timestamp <= timestamp) {
+ while (last->timestamp <= timestamp) {
+ p = last->list.next;
+ if (p == &oe->events) {
+ list_add_tail(&new->list, &oe->events);
oe->max_timestamp = timestamp;
return;
}
- sample = list_entry(p, struct ordered_event, list);
+ last = list_entry(p, struct ordered_event, list);
}
- list_add_tail(&new->list, &sample->list);
+ list_add_tail(&new->list, &last->list);
} else {
- while (sample->timestamp > timestamp) {
- p = sample->list.prev;
- if (p == &oe->samples) {
- list_add(&new->list, &oe->samples);
+ while (last->timestamp > timestamp) {
+ p = last->list.prev;
+ if (p == &oe->events) {
+ list_add(&new->list, &oe->events);
return;
}
- sample = list_entry(p, struct ordered_event, list);
+ last = list_entry(p, struct ordered_event, list);
}
- list_add(&new->list, &sample->list);
+ list_add(&new->list, &last->list);
}
}
@@ -627,7 +625,7 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
struct perf_sample *sample, u64 file_offset)
{
struct ordered_events *oe = &s->ordered_events;
- struct list_head *sc = &oe->sample_cache;
+ struct list_head *cache = &oe->cache;
u64 timestamp = sample->time;
struct ordered_event *new;
@@ -639,20 +637,20 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
return -EINVAL;
}
- if (!list_empty(sc)) {
- new = list_entry(sc->next, struct ordered_event, list);
+ if (!list_empty(cache)) {
+ new = list_entry(cache->next, struct ordered_event, list);
list_del(&new->list);
- } else if (oe->sample_buffer) {
- new = oe->sample_buffer + oe->sample_buffer_idx;
- if (++oe->sample_buffer_idx == MAX_SAMPLE_BUFFER)
- oe->sample_buffer = NULL;
+ } else if (oe->buffer) {
+ new = oe->buffer + oe->buffer_idx;
+ if (++oe->buffer_idx == MAX_SAMPLE_BUFFER)
+ oe->buffer = NULL;
} else {
- oe->sample_buffer = malloc(MAX_SAMPLE_BUFFER * sizeof(*new));
- if (!oe->sample_buffer)
+ oe->buffer = malloc(MAX_SAMPLE_BUFFER * sizeof(*new));
+ if (!oe->buffer)
return -ENOMEM;
- list_add(&oe->sample_buffer->list, &oe->to_free);
- oe->sample_buffer_idx = 2;
- new = oe->sample_buffer + 1;
+ list_add(&oe->buffer->list, &oe->to_free);
+ oe->buffer_idx = 2;
+ new = oe->buffer + 1;
}
new->timestamp = timestamp;
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index f6baf935917a..419eb50e1cd3 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -20,13 +20,13 @@ struct ordered_events {
u64 last_flush;
u64 next_flush;
u64 max_timestamp;
- struct list_head samples;
- struct list_head sample_cache;
+ struct list_head events;
+ struct list_head cache;
struct list_head to_free;
- struct ordered_event *sample_buffer;
- struct ordered_event *last_sample;
- int sample_buffer_idx;
- unsigned int nr_samples;
+ struct ordered_event *buffer;
+ struct ordered_event *last;
+ int buffer_idx;
+ unsigned int nr_events;
};
struct perf_session {
--
1.9.3
next prev parent reply other threads:[~2014-08-04 16:18 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-04 16:17 [GIT PULL 00/33] perf/core improvements and fixes Arnaldo Carvalho de Melo
2014-08-04 16:17 ` Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 01/33] perf tools: Fix arm64 build error Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 02/33] perf evlist: Don't run workload if not told to Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 03/33] perf symbols: Make sure --symfs usage includes the path separator Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 04/33] perf kvm stat: Properly show submicrosecond times Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 05/33] perf record: Allow the user to disable time stamps Arnaldo Carvalho de Melo
2014-08-05 6:08 ` Ingo Molnar
2014-08-05 13:33 ` Arnaldo Carvalho de Melo
2014-08-12 14:58 ` Ingo Molnar
2014-08-12 15:29 ` Arnaldo Carvalho de Melo
2014-08-13 5:08 ` Ingo Molnar
2014-08-05 14:17 ` Andi Kleen
2014-08-05 14:31 ` Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 06/33] perf tools: Rename ordered_samples bool to ordered_events Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 07/33] perf tools: Rename ordered_samples struct " Arnaldo Carvalho de Melo
2014-08-04 16:17 ` Arnaldo Carvalho de Melo [this message]
2014-08-04 16:17 ` [PATCH 09/33] perf tools: Add ordered_events__(new|delete) interface Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 10/33] perf tools: Factor ordered_events__flush to be more generic Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 11/33] perf tools: Limit ordered events queue size Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 12/33] perf tools: Flush ordered events in case of allocation failure Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 13/33] perf tools: Make perf_session__deliver_event global Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 14/33] perf tools: Create ordered-events object Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 15/33] perf tools: Use list_move in ordered_events_delete function Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 16/33] perf tools: Add ordered_events__init function Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 17/33] perf tools: Add ordered_events__free function Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 18/33] perf tools: Add perf_config_u64 function Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 19/33] perf tools: Add report.queue-size config file option Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 20/33] perf tools: Add debug prints for ordered events queue Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 21/33] perf tools: Allow out of order messages in forced flush Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 22/33] perf tools: Show better error message in case we fail to open counters due to EBUSY error Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 23/33] perf kmem: Do not ignore mmap events Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 24/33] perf tools: Fix make PYTHON override Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 25/33] perf tools: Left-align output contents Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 26/33] perf tools: Make __hpp__fmt() receive an additional len argument Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 27/33] perf tools: Save column length in perf_hpp_fmt Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 28/33] perf report: Honor column width setting Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 29/33] perf top: Add -w option for setting column width Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 30/33] perf tools: Add name field into perf_hpp_fmt Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 31/33] perf tools: Fix column alignment when headers aren't shown on TUI Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 32/33] perf tools: Fix PERF_FLAG_FD_CLOEXEC flag probing event type open counters due to EBUSY error Arnaldo Carvalho de Melo
2014-08-04 16:17 ` [PATCH 33/33] perf tools: Default to python version 2 Arnaldo Carvalho de Melo
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=1407169064-25625-9-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=jean.pihet@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.