From: Andi Kleen <andi@firstfloor.org>
To: tytso@mit.edu
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 3/3] random: Add pool name to urandom_read trace point
Date: Mon, 29 Feb 2016 21:17:06 -0800 [thread overview]
Message-ID: <1456809426-19341-3-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1456809426-19341-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
Now that we have multiple nonblocking_pools it makes sense to report
the name of the pool in the urandom_read trace point. Extend
the trace point to report the name too.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
drivers/char/random.c | 2 +-
include/trace/events/random.h | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 21ae44b..00c7be2 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1590,7 +1590,7 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
nbytes = min_t(size_t, nbytes, INT_MAX >> (ENTROPY_SHIFT + 3));
ret = extract_entropy_user(pool, buf, nbytes);
- trace_urandom_read(8 * nbytes, ENTROPY_BITS(pool),
+ trace_urandom_read(pool->name, 8 * nbytes, ENTROPY_BITS(pool),
ENTROPY_BITS(pool));
return ret;
}
diff --git a/include/trace/events/random.h b/include/trace/events/random.h
index 4684de3..3b5ab5a 100644
--- a/include/trace/events/random.h
+++ b/include/trace/events/random.h
@@ -288,25 +288,27 @@ TRACE_EVENT(random_read,
);
TRACE_EVENT(urandom_read,
- TP_PROTO(int got_bits, int pool_left, int input_left),
+ TP_PROTO(const char *pool, int got_bits, int pool_left, int input_left),
- TP_ARGS(got_bits, pool_left, input_left),
+ TP_ARGS(pool, got_bits, pool_left, input_left),
TP_STRUCT__entry(
+ __field( const char *, pool )
__field( int, got_bits )
__field( int, pool_left )
__field( int, input_left )
),
TP_fast_assign(
+ __entry->pool = pool;
__entry->got_bits = got_bits;
__entry->pool_left = pool_left;
__entry->input_left = input_left;
),
TP_printk("got_bits %d nonblocking_pool_entropy_left %d "
- "input_entropy_left %d", __entry->got_bits,
- __entry->pool_left, __entry->input_left)
+ "input_entropy_left %d from %s", __entry->got_bits,
+ __entry->pool_left, __entry->input_left, __entry->pool)
);
#endif /* _TRACE_RANDOM_H */
--
2.5.0
next prev parent reply other threads:[~2016-03-01 5:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 5:17 [PATCH 1/3] Make /dev/urandom scalable Andi Kleen
2016-03-01 5:17 ` [PATCH 2/3] random: Make input to output pool balancing per cpu Andi Kleen
2016-03-01 5:17 ` Andi Kleen [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-02-10 23:01 Scalable random patchkit revisited Andi Kleen
2016-02-10 23:01 ` [PATCH 3/3] random: Add pool name to urandom_read trace point Andi Kleen
2015-10-06 22:05 [PATCH 1/3] Make /dev/urandom scalable Andi Kleen
2015-10-06 22:05 ` [PATCH 3/3] random: Add pool name to urandom_read trace point Andi Kleen
2015-09-24 17:19 Updated scalable urandom patchkit Andi Kleen
2015-09-24 17:19 ` [PATCH 3/3] random: Add pool name to urandom_read trace point Andi Kleen
2015-09-22 23:16 [PATCH 1/3] Make /dev/urandom scalable Andi Kleen
2015-09-22 23:16 ` [PATCH 3/3] random: Add pool name to urandom_read trace point Andi Kleen
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=1456809426-19341-3-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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).