All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH v2] libtracefs: Add new API for open trace marker file
Date: Thu, 8 Apr 2021 09:41:58 -0400	[thread overview]
Message-ID: <20210408094158.018286c8@gandalf.local.home> (raw)
In-Reply-To: <CAPpZLN7-H536pJxU1ovn6L_wGzmFOzXtVngdWrcSwH+LQvRVdw@mail.gmail.com>

On Thu, 8 Apr 2021 16:21:52 +0300
Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:


> I find "tracefs_print_" a little bit confusing, like printing
> something on console. I think the name should stress that a user
> string/data is written in the trace buffer. I would like to combine
> string and binary APIs into one set, something like:

How so? We use it in the kernel "trace_printk()" there's no confusion there.

And to me, "user string written in the trace buffer" is exactly what
I think when I see "tracefs_printf()".

> 
>  tracefs_user_trace_init();  /* open both trace_marker and
> trace_marker_raw files, or have flags to specify what file to open,
> string or data*/
>  tracefs_user_trace_printf(); /* write to  trace_marker */
>  tracefs_user_trace_vprintf(); /* write to  trace_marker */
>  tracefs_user_trace_binary(); /* write to  trace_marker_raw */
>  tracefs_user_trace_init(); /* close both string and data fd, if open */
> 

I have no idea what "user_trace" is. What does that mean? There's no
precedence for it.

"tracefs_printf()" is short and to the point, and states exactly what you
want. It does a printf() into the tracefs system. How is that confusing?

We have fprintf() which does a printf into a file point.
We have sprintf() which does an printf into a string.

Thus, it makes sense to have "tracefs_printf()" which does a printf into
the tracefs file system. Just like we have trace_seq_printf() which does a
printf() into the trace_seq.

"printf()" means string manipulation, and has nothing to do with consoles.

I personally hate long function names, especially ones that I may use
a lot of.

Keeping with the other APIs trace_printf() is the only one that seems
reasonable.

-- Steve

      reply	other threads:[~2021-04-08 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  8:08 [PATCH v2] libtracefs: Add new API for open trace marker file Tzvetomir Stoyanov (VMware)
2021-04-08 12:59 ` Steven Rostedt
2021-04-08 13:21   ` Tzvetomir Stoyanov
2021-04-08 13:41     ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408094158.018286c8@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tz.stoyanov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.