diff mbox series

[v2,05/27] kernel-shark: Count the number of readout interfaces

Message ID 20210211103205.418588-6-y.karadz@gmail.com (mailing list archive)
State Accepted
Commit 7b8e70b1b1f128c59b735688833a829291de4337
Headers show
Series Complete the KernelShark v2 transformation | expand

Commit Message

Yordan Karadzhov Feb. 11, 2021, 10:31 a.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;
 		}