Re: [PATCH 4/5] libtracefs: New APIs for getting existing trace instance

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

 



On Fri, 15 Jan 2021 07:04:09 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:

> +++ b/include/tracefs.h
> @@ -20,9 +20,12 @@ struct tracefs_instance;
>  
>  void tracefs_instance_free(struct tracefs_instance *instance);
>  struct tracefs_instance *tracefs_instance_create(const char *name);
> +struct tracefs_instance *tracefs_instance_get(const char *tracing_dir,
> +					      const char *name);

I don't think I care for the "_get" name here because it doesn't get
anything, it allocates it. As below, we have functions with "_get" that
return something that already exists (and why it returns a "const" value).

I think the above should be called:

  tracefs_instance_alloc()

?

-- Steve


>  int tracefs_instance_destroy(struct tracefs_instance *instance);
>  bool tracefs_instance_is_new(struct tracefs_instance *instance);
>  const char *tracefs_instance_get_name(struct tracefs_instance *instance);
> +const char *tracefs_instance_get_trace_dir(struct tracefs_instance *instance);
>  char *
>  tracefs_instance_get_file(struct tracefs_instance *instance, const char *file);
>  char *tracefs_instance_get_dir(struct tracefs_instance *instance);
> diff --git a/src/tracefs-instance.c b/src/tracefs-instance.c



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

  Powered by Linux