linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Stevie Alvarez <stevie.6strings@gmail.com>
Cc: linux-trace-devel@vger.kernel.org, Ross Zwisler <zwisler@google.com>
Subject: Re: [PATCH v3 1/6] histograms: Initial histograms interface
Date: Tue, 8 Aug 2023 20:56:15 -0400	[thread overview]
Message-ID: <20230808205615.56d03f53@gandalf.local.home> (raw)
In-Reply-To: <20230808215105.GA1258@3xKetch>

On Tue, 8 Aug 2023 17:51:05 -0400
Stevie Alvarez <stevie.6strings@gmail.com> wrote:

> On Tue, Aug 08, 2023 at 03:35:47PM -0400, Steven Rostedt wrote:
> > On Tue,  8 Aug 2023 12:11:54 -0400
> > Stevie Alvarez <stevie.6strings@gmail.com> wrote:
> >   
> > > +/*
> > > + * Trace data entry for a traceeval histogram
> > > + * Constitutes keys and values.
> > > + */
> > > +union traceeval_data {
> > > +	char				*string;  
> > 
> > We need to also add:
> > 
> > 	const char			*cstring;
> > 
> > At least for the user interface, as I'm converting task-eval over to this,
> > and I need to assign const strings to this union.  
> 
> I assume I should treat cstring the same as string, execept because it's
> constant, it should not be updated on insertion, correct?

On insertion we have:

static int copy_traceeval_data(struct traceeval_type *type,
				const union traceeval_data *orig,
				union traceeval_data *copy)
{
	*copy = *orig;

	switch (type->type) {
	case TRACEEVAL_TYPE_STRING:
		copy->string = NULL;
		if (orig->string)
			copy->string = strdup(orig->string);
		if (!copy->string)
			return -1;
		break;

	default:
		break;
	}

	return 0;
}

So we copy it. That means we really can do whatever we want to it.

-- Steve

  reply	other threads:[~2023-08-09  0:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 16:11 [PATCH v3 0/6] histograms: Add query and insert Stevie Alvarez
2023-08-08 16:11 ` [PATCH v3 1/6] histograms: Initial histograms interface Stevie Alvarez
2023-08-08 18:08   ` Steven Rostedt
2023-08-08 19:35   ` Steven Rostedt
2023-08-08 21:51     ` Stevie Alvarez
2023-08-09  0:56       ` Steven Rostedt [this message]
2023-08-08 20:05   ` Steven Rostedt
2023-08-08 16:11 ` [PATCH v3 2/6] histograms: Add traceeval initialize and release Stevie Alvarez
2023-08-08 18:15   ` Steven Rostedt
2023-08-08 16:11 ` [PATCH v3 3/6] histograms: Add traceeval compare Stevie Alvarez
2023-08-08 18:18   ` Steven Rostedt
2023-08-08 16:11 ` [PATCH v3 4/6] histograms: Add traceeval query Stevie Alvarez
2023-08-08 18:55   ` Steven Rostedt
2023-08-08 16:11 ` [PATCH v3 5/6] histograms: Add traceeval insert Stevie Alvarez
2023-08-08 19:59   ` Ross Zwisler
2023-08-08 23:32     ` Stevie Alvarez
2023-08-08 23:51       ` Ross Zwisler
2023-08-08 18:01 ` [PATCH v3 0/6] histograms: Add query and insert Stevie Alvarez

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=20230808205615.56d03f53@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=stevie.6strings@gmail.com \
    --cc=zwisler@google.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).