Re: [PATCH 05/12] libtracefs: Reimplement tracefs_kprobes_get API

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

 



On Thu, 28 Oct 2021 15:09:00 +0300
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> In order to unify the code and reuse the internal helpers for dynamic
> events helpers, the tracefs_kprobes_get() API is reimplemented using
> the new dynamic events APIs.
> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
> ---
>  include/tracefs.h     |   2 +-
>  src/tracefs-kprobes.c | 127 +++++++++++-------------------------------
>  2 files changed, 33 insertions(+), 96 deletions(-)
> 
> diff --git a/include/tracefs.h b/include/tracefs.h
> index c7b9179..d4ac8fb 100644
> --- a/include/tracefs.h
> +++ b/include/tracefs.h
> @@ -259,7 +259,7 @@ int tracefs_kprobe_raw(const char *system, const char *event,
>  		       const char *addr, const char *format);
>  int tracefs_kretprobe_raw(const char *system, const char *event,
>  			  const char *addr, const char *format);
> -char **tracefs_kprobes_get(enum tracefs_kprobe_type type);
> +int tracefs_kprobes_get(enum tracefs_kprobe_type type, struct tracefs_dynevent ***kprobes);

Like I mentioned for the other patches. This should return the array,
and not be passing in an object to allocate.

General rule is, if you need to have a parameter with three
dereferences (***) you're doing it wrong. ;-)

>  enum tracefs_kprobe_type tracefs_kprobe_info(const char *group, const char *event,
>  					     char **type, char **addr, char **format);
>  
> diff --git a/src/tracefs-kprobes.c b/src/tracefs-kprobes.c


-- Steve



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

  Powered by Linux