Re: [PATCH 4/4] trace-cruncher: Allow for detachable kprobes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 26.07.21 г. 12:07, Yordan Karadzhov (VMware) wrote:


On 23.07.21 г. 0:24, Steven Rostedt wrote:
On Mon, 12 Jul 2021 15:32:42 +0300
"Yordan Karadzhov (VMware)" <y.karadz@xxxxxxxxx> wrote:


@@ -1617,8 +1622,9 @@ PyObject *PyFtrace_register_kretprobe(PyObject *self, PyObject *args,
          return NULL;
      }
-    if (!store_new_kprobe(event))
-        return NULL;
+    if (!detached)
+        if (!store_new_kprobe(event))
+            return NULL;

I wonder if it would be more consistent and helpful if we created a
structure for kprobes like we do for instances, and this way we can
save the "detached" field in that structure, and not free it on destroy.

This way, even though the kprobes are detached it may still be needed
in the future to list all kprobes that were created by the application,
regardless if they are detached or not.

Yes, this make sense.

BTW we should discuss what is the best data structure to store the kprobes that were created. In the case of the instances we really need to use a binary tree, because we identify the instances only by name (string) so we are forced to do a lot of searches. Initially I assumed that we will need to do searches for kprobes as well. However, so far we only do listing.

Maybe, we should switch from tree to linked list? This will greatly simplify everything.


I am deferring this patch together with the previous one ("Allow for detachable instances") for possible redesign.

Thanks,
Yordan

Thanks!
Yordan






-- Steve




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux