diff mbox series

[05/24] kernel-shark: Count the number of readout interfaces

Message ID 20210201172358.175407-6-y.karadz@gmail.com (mailing list archive)
State Superseded
Headers show
Series Complete the KernelShark v2 transformation | expand

Commit Message

Yordan Karadzhov Feb. 1, 2021, 5:23 p.m. UTC
The number of readout interfaces, successfully registered by
the plugins is supposed to be counted and stored in the session
context object. Although this is not used by the GUI, we want
the API to support this feature.

Sgned-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/libkshark-plugin.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/src/libkshark-plugin.c b/src/libkshark-plugin.c
index bc68186..ebd2579 100644
--- a/src/libkshark-plugin.c
+++ b/src/libkshark-plugin.c
@@ -457,6 +457,7 @@  kshark_register_input(struct kshark_context *kshark_ctx,
 	input->interface = plugin;
 	input->next = kshark_ctx->inputs;
 	kshark_ctx->inputs = input;
+	kshark_ctx->n_inputs++;
 	return input;
 
  conflict:
@@ -489,6 +490,7 @@  void kshark_unregister_input(struct kshark_context *kshark_ctx,
 			*last = this_input->next;
 
 			free(this_input);
+			kshark_ctx->n_inputs--;
 
 			return;
 		}