2020-05-21 14:09:19

by Yann Droneaud

[permalink] [raw]
Subject: [PATCH 0/4] random/trace: remove unused function

Hi,

After simplifications brought recently to random [1], some
trace functions are no more needed. This patchset removes
them.

[1] https://lore.kernel.org/linux-api/[email protected]/

Yann Droneaud (4):
random/trace: remove unused trace_random_read()
random/trace: remove unused trace_push_to_pool()
random/trace: remove unused trace_extract_entropy_user()
random/trace: remove unused trace_xfer_secondary_pool()

include/trace/events/random.h | 93 +----------------------------------
1 file changed, 1 insertion(+), 92 deletions(-)

--
2.25.4


2020-05-21 14:09:24

by Yann Droneaud

[permalink] [raw]
Subject: [PATCH 3/4] random/trace: remove unused trace_extract_entropy_user()

Since commit 90ea1c6436d2 ('random: remove the blocking pool')
trace_extract_entropy_user() is unused.

As the result, trace_extract_entropy() is the only trace
function needed, thus there's no need for a separate event
class / event.

Cc: Andy Lutomirski <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Signed-off-by: Yann Droneaud <[email protected]>
---
include/trace/events/random.h | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/include/trace/events/random.h b/include/trace/events/random.h
index d5aa662294fe..c2256250e3ef 100644
--- a/include/trace/events/random.h
+++ b/include/trace/events/random.h
@@ -198,7 +198,7 @@ DEFINE_EVENT(random__get_random_bytes, get_random_bytes_arch,
TP_ARGS(nbytes, IP)
);

-DECLARE_EVENT_CLASS(random__extract_entropy,
+TRACE_EVENT(extract_entropy,
TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
unsigned long IP),

@@ -223,21 +223,6 @@ DECLARE_EVENT_CLASS(random__extract_entropy,
(void *)__entry->IP)
);

-
-DEFINE_EVENT(random__extract_entropy, extract_entropy,
- TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
- unsigned long IP),
-
- TP_ARGS(pool_name, nbytes, entropy_count, IP)
-);
-
-DEFINE_EVENT(random__extract_entropy, extract_entropy_user,
- TP_PROTO(const char *pool_name, int nbytes, int entropy_count,
- unsigned long IP),
-
- TP_ARGS(pool_name, nbytes, entropy_count, IP)
-);
-
TRACE_EVENT(urandom_read,
TP_PROTO(int got_bits, int pool_left, int input_left),

--
2.25.4

2020-05-21 14:09:35

by Yann Droneaud

[permalink] [raw]
Subject: [PATCH 4/4] random/trace: remove unused trace_xfer_secondary_pool()

Since commit 84df7cdfbb21 ('random: delete code to pull data into pools'),
trace_xfer_secondary_pool() is unused.

Cc: Andy Lutomirski <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Signed-off-by: Yann Droneaud <[email protected]>
---
include/trace/events/random.h | 29 -----------------------------
1 file changed, 29 deletions(-)

diff --git a/include/trace/events/random.h b/include/trace/events/random.h
index c2256250e3ef..8cf287423571 100644
--- a/include/trace/events/random.h
+++ b/include/trace/events/random.h
@@ -139,35 +139,6 @@ TRACE_EVENT(add_disk_randomness,
MINOR(__entry->dev), __entry->input_bits)
);

-TRACE_EVENT(xfer_secondary_pool,
- TP_PROTO(const char *pool_name, int xfer_bits, int request_bits,
- int pool_entropy, int input_entropy),
-
- TP_ARGS(pool_name, xfer_bits, request_bits, pool_entropy,
- input_entropy),
-
- TP_STRUCT__entry(
- __field( const char *, pool_name )
- __field( int, xfer_bits )
- __field( int, request_bits )
- __field( int, pool_entropy )
- __field( int, input_entropy )
- ),
-
- TP_fast_assign(
- __entry->pool_name = pool_name;
- __entry->xfer_bits = xfer_bits;
- __entry->request_bits = request_bits;
- __entry->pool_entropy = pool_entropy;
- __entry->input_entropy = input_entropy;
- ),
-
- TP_printk("pool %s xfer_bits %d request_bits %d pool_entropy %d "
- "input_entropy %d", __entry->pool_name, __entry->xfer_bits,
- __entry->request_bits, __entry->pool_entropy,
- __entry->input_entropy)
-);
-
DECLARE_EVENT_CLASS(random__get_random_bytes,
TP_PROTO(int nbytes, unsigned long IP),

--
2.25.4

2020-05-21 14:09:42

by Yann Droneaud

[permalink] [raw]
Subject: [PATCH 2/4] random/trace: remove unused trace_push_to_pool()

Since commit 90ea1c6436d2 ('random: remove the blocking pool')
trace_push_to_pool() is unused.

Cc: Andy Lutomirski <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Signed-off-by: Yann Droneaud <[email protected]>
---
include/trace/events/random.h | 22 ----------------------
1 file changed, 22 deletions(-)

diff --git a/include/trace/events/random.h b/include/trace/events/random.h
index 087ae7e8ae13..d5aa662294fe 100644
--- a/include/trace/events/random.h
+++ b/include/trace/events/random.h
@@ -85,28 +85,6 @@ TRACE_EVENT(credit_entropy_bits,
__entry->entropy_count, (void *)__entry->IP)
);

-TRACE_EVENT(push_to_pool,
- TP_PROTO(const char *pool_name, int pool_bits, int input_bits),
-
- TP_ARGS(pool_name, pool_bits, input_bits),
-
- TP_STRUCT__entry(
- __field( const char *, pool_name )
- __field( int, pool_bits )
- __field( int, input_bits )
- ),
-
- TP_fast_assign(
- __entry->pool_name = pool_name;
- __entry->pool_bits = pool_bits;
- __entry->input_bits = input_bits;
- ),
-
- TP_printk("%s: pool_bits %d input_pool_bits %d",
- __entry->pool_name, __entry->pool_bits,
- __entry->input_bits)
-);
-
TRACE_EVENT(debit_entropy,
TP_PROTO(const char *pool_name, int debit_bits),

--
2.25.4

2020-05-21 14:09:42

by Yann Droneaud

[permalink] [raw]
Subject: [PATCH 1/4] random/trace: remove unused trace_random_read()

Since commit 30c08efec888 ('random: make /dev/random be almost like /dev/urandom'),
trace_random_read() is unused.

Cc: Andy Lutomirski <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Signed-off-by: Yann Droneaud <[email protected]>
---
include/trace/events/random.h | 25 -------------------------
1 file changed, 25 deletions(-)

diff --git a/include/trace/events/random.h b/include/trace/events/random.h
index 32c10a515e2d..087ae7e8ae13 100644
--- a/include/trace/events/random.h
+++ b/include/trace/events/random.h
@@ -260,31 +260,6 @@ DEFINE_EVENT(random__extract_entropy, extract_entropy_user,
TP_ARGS(pool_name, nbytes, entropy_count, IP)
);

-TRACE_EVENT(random_read,
- TP_PROTO(int got_bits, int need_bits, int pool_left, int input_left),
-
- TP_ARGS(got_bits, need_bits, pool_left, input_left),
-
- TP_STRUCT__entry(
- __field( int, got_bits )
- __field( int, need_bits )
- __field( int, pool_left )
- __field( int, input_left )
- ),
-
- TP_fast_assign(
- __entry->got_bits = got_bits;
- __entry->need_bits = need_bits;
- __entry->pool_left = pool_left;
- __entry->input_left = input_left;
- ),
-
- TP_printk("got_bits %d still_needed_bits %d "
- "blocking_pool_entropy_left %d input_entropy_left %d",
- __entry->got_bits, __entry->got_bits, __entry->pool_left,
- __entry->input_left)
-);
-
TRACE_EVENT(urandom_read,
TP_PROTO(int got_bits, int pool_left, int input_left),

--
2.25.4