From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, namhyung@kernel.org,
adrian.hunter@intel.com, hpa@zytor.com, tglx@linutronix.de,
fweisbec@gmail.com, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, ldv@altlinux.org, lclaudio@uudg.org,
rostedt@goodmis.org, mingo@kernel.org, acme@redhat.com,
linux-kernel@vger.kernel.org, esyr@redhat.com
Subject: [tip:perf/core] perf ordered_events: Add first_time() method
Date: Fri, 14 Dec 2018 13:01:42 -0800 [thread overview]
Message-ID: <tip-appp27jw1ul8kgg872j43r5o@git.kernel.org> (raw)
Commit-ID: 5a0cb2ffce065d738d90c0bf372a79ddc961c9ff
Gitweb: https://git.kernel.org/tip/5a0cb2ffce065d738d90c0bf372a79ddc961c9ff
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 6 Dec 2018 14:38:52 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 6 Dec 2018 16:43:28 -0300
perf ordered_events: Add first_time() method
To get the timestamp in the first event in the queue.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Dmitry Levin <ldv@altlinux.org>
Cc: Eugene Syromiatnikov <esyr@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@uudg.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/n/tip-appp27jw1ul8kgg872j43r5o@git.kernel.org
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/ordered-events.c | 11 +++++++++++
tools/perf/util/ordered-events.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index 46965643020b..897589507d97 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -343,6 +343,17 @@ int ordered_events__flush_time(struct ordered_events *oe, u64 timestamp)
return __ordered_events__flush(oe, OE_FLUSH__TIME, timestamp);
}
+u64 ordered_events__first_time(struct ordered_events *oe)
+{
+ struct ordered_event *event;
+
+ if (list_empty(&oe->events))
+ return 0;
+
+ event = list_first_entry(&oe->events, struct ordered_event, list);
+ return event->timestamp;
+}
+
void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver,
void *data)
{
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index f352af20e167..0920fb0ec6cc 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -61,6 +61,7 @@ void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t d
void *data);
void ordered_events__free(struct ordered_events *oe);
void ordered_events__reinit(struct ordered_events *oe);
+u64 ordered_events__first_time(struct ordered_events *oe);
static inline
void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
WARNING: multiple messages have this Message-ID
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: fweisbec@gmail.com, esyr@redhat.com, peterz@infradead.org,
namhyung@kernel.org, lclaudio@uudg.org, rostedt@goodmis.org,
mingo@kernel.org, tglx@linutronix.de, acme@redhat.com,
hpa@zytor.com, linux-kernel@vger.kernel.org, jolsa@kernel.org,
ldv@altlinux.org, alexander.shishkin@linux.intel.com,
adrian.hunter@intel.com
Subject: [tip:perf/core] perf ordered_events: Add first_time() method
Date: Tue, 18 Dec 2018 06:28:43 -0800 [thread overview]
Message-ID: <tip-appp27jw1ul8kgg872j43r5o@git.kernel.org> (raw)
Message-ID: <20181218142843.T1V8U5NVm7V7_AnxpvHwMpg9KR3sqt4LCpkhi8vvXOs@z> (raw)
Commit-ID: 83356b3d124af5ae472ce1358222f6b7749d2322
Gitweb: https://git.kernel.org/tip/83356b3d124af5ae472ce1358222f6b7749d2322
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Thu, 6 Dec 2018 14:38:52 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 17 Dec 2018 15:02:17 -0300
perf ordered_events: Add first_time() method
To get the timestamp in the first event in the queue.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Dmitry Levin <ldv@altlinux.org>
Cc: Eugene Syromiatnikov <esyr@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Luis Cláudio Gonçalves <lclaudio@uudg.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/n/tip-appp27jw1ul8kgg872j43r5o@git.kernel.org
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/ordered-events.c | 11 +++++++++++
tools/perf/util/ordered-events.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index 46965643020b..897589507d97 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -343,6 +343,17 @@ int ordered_events__flush_time(struct ordered_events *oe, u64 timestamp)
return __ordered_events__flush(oe, OE_FLUSH__TIME, timestamp);
}
+u64 ordered_events__first_time(struct ordered_events *oe)
+{
+ struct ordered_event *event;
+
+ if (list_empty(&oe->events))
+ return 0;
+
+ event = list_first_entry(&oe->events, struct ordered_event, list);
+ return event->timestamp;
+}
+
void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver,
void *data)
{
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index f352af20e167..0920fb0ec6cc 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -61,6 +61,7 @@ void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t d
void *data);
void ordered_events__free(struct ordered_events *oe);
void ordered_events__reinit(struct ordered_events *oe);
+u64 ordered_events__first_time(struct ordered_events *oe);
static inline
void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
next reply other threads:[~2018-12-14 21:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 21:01 tip-bot for Jiri Olsa [this message]
2018-12-18 14:28 ` tip-bot for Jiri Olsa
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=tip-appp27jw1ul8kgg872j43r5o@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=esyr@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=lclaudio@uudg.org \
--cc=ldv@altlinux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®