linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v2 01/10] trace-cmd library: New API for allocating an output handler
Date: Tue, 23 Nov 2021 22:37:29 -0500	[thread overview]
Message-ID: <20211123223729.3cbec889@rorschach.local.home> (raw)
In-Reply-To: <20211111150321.85979-2-tz.stoyanov@gmail.com>

On Thu, 11 Nov 2021 17:03:12 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> +/**
> + * tracecmd_output_allocate - allocate new output handler to a trace file
> + * @handle: file descriptor to an empty file, it can be -1 if the handler
> + *	    will not write to a file

Nit, but technically, the parameter description should fit on one line.
If more needs to be said about it, it can be done in the description,
where every reference of the name has the "@" attached to it.

I only mentioned this because I noticed it in a few places already.

-- Steve

> + *
> + * This API only allocates a handler and performs minimal initialization.
> + * No data is written in the file.
> + *
> + * Returns pointer to a newly allocated file descriptor, that can be used
> + * with other library APIs. In case of an error, NULL is returned. The returned
> + * handler must be freed with tracecmd_output_close() or tracecmd_output_free()
> + */
> +struct tracecmd_output *tracecmd_output_allocate(int fd)
> +{
> +	struct tracecmd_output *handle;
> +
> +	handle = calloc(1, sizeof(*handle));
> +	if (!handle)
> +		return NULL;
> +
> +	handle->fd = fd;
> +
> +	handle->file_version = FILE_VERSION;
> +
> +	handle->page_size = getpagesize();
> +	handle->big_endian = tracecmd_host_bigendian();
> +
> +	list_head_init(&handle->options);
> +
> +	handle->file_state = TRACECMD_FILE_ALLOCATED;
> +
> +	return handle;
> +}
> +
> +
>  static int select_file_version(struct tracecmd_output *handle,
>  				struct tracecmd_input *ihandle)
>  {


  reply	other threads:[~2021-11-24  3:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 15:03 [PATCH v2 00/10] Refactor APIs for creating output handler Tzvetomir Stoyanov (VMware)
2021-11-11 15:03 ` [PATCH v2 01/10] trace-cmd library: New API for allocating an " Tzvetomir Stoyanov (VMware)
2021-11-24  3:37   ` Steven Rostedt [this message]
2021-11-11 15:03 ` [PATCH v2 02/10] trace-cmd library: New API for setting a message context to " Tzvetomir Stoyanov (VMware)
2021-11-24  3:41   ` Steven Rostedt
2021-11-11 15:03 ` [PATCH v2 03/10] trace-cmd library: New API for setting a custom trace directory " Tzvetomir Stoyanov (VMware)
2021-11-24  3:33 ` [PATCH v2 00/10] Refactor APIs for creating " Steven Rostedt

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=20211123223729.3cbec889@rorschach.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).