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 1/2] trace-cmd: Add validation for reading and writing trace.dat files
Date: Thu, 18 Feb 2021 09:23:53 -0500	[thread overview]
Message-ID: <20210218092353.51fdc9e1@gandalf.local.home> (raw)
In-Reply-To: <CAPpZLN7L4Yg4ePE-dWQ+WHf6h_8gShcYBEBSGrxDrvV32DOv9w@mail.gmail.com>

On Thu, 18 Feb 2021 05:49:41 +0200
Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:

> This works for the current structure of trace.dat file, we can have
> these assumptions
> and use state instead of a bitmask. But in the future, if we decide to
> add optional
> sections in the file, or more complex branches - assumptions could not
> be valid and
> state should be changed to something more flexible.

And why I think it's good to have both a state enumeration (for things that
must exist in a particular order) and flags for things that are optional
and you don't care about order.

> As this is not part of any external API, I'm OK to change bitmask to
> state. This easily
> can be redesigned in the future, if needed.

Yes, this can most definitely change in the future, and I like that you are
thinking about the future and ways to be flexible. But we also don't want
to make things too complex. Having a state enumeration (counter) and flags
together handles all cases, and I would recommend doing so as a counter.
If there's something that's optional, we can use the flags.

Care to send a v2?

Thanks!

-- Steve

  reply	other threads:[~2021-02-18 17:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  4:23 [PATCH 0/2] Fix listener and add trace file validation Tzvetomir Stoyanov (VMware)
2021-02-17  4:23 ` [PATCH 1/2] trace-cmd: Add validation for reading and writing trace.dat files Tzvetomir Stoyanov (VMware)
2021-02-17 16:00   ` Steven Rostedt
2021-02-17 16:33     ` Tzvetomir Stoyanov
2021-02-17 18:27       ` Steven Rostedt
2021-02-18  3:49         ` Tzvetomir Stoyanov
2021-02-18 14:23           ` Steven Rostedt [this message]
2021-02-17  4:23 ` [PATCH 2/2] trace-cmd: Fix broken listener and add error checks Tzvetomir Stoyanov (VMware)
2021-02-17 19:46   ` 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=20210218092353.51fdc9e1@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.