linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: Ross Zwisler <zwisler@google.com>,
	Stevie Alvarez <stevie.6strings@gmail.com>
Subject: Re: [PATCH 7/9] libtraceeval: Add size checks to insert and query functions
Date: Thu, 17 Aug 2023 18:39:43 -0400	[thread overview]
Message-ID: <20230817183943.500343b4@gandalf.local.home> (raw)
In-Reply-To: <20230817222422.118568-8-rostedt@goodmis.org>

On Thu, 17 Aug 2023 18:24:20 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> --- a/include/traceeval-hist.h
> +++ b/include/traceeval-hist.h
> @@ -186,15 +186,23 @@ struct traceeval *traceeval_init(struct traceeval_type *keys,
>  
>  void traceeval_release(struct traceeval *teval);
>  
> -int traceeval_insert(struct traceeval *teval,
> -		     const struct traceeval_data *keys,
> -		     const struct traceeval_data *vals);
> +int traceeval_insert_size(struct traceeval *teval,
> +			  const struct traceeval_data *keys, size_t nr_keys,
> +			  const struct traceeval_data *vals, size_t nr_vals);
> +
> +#define traceeval_insert(teval, keys, vals)				\
> +	traceeval_insert_size(teval, keys, sizeof(keys) / sizeof(keys[0]), \
> +			      vals, sizeof(vals) / sizeof(vals[0]))
>  
>  int traceeval_remove(struct traceeval *teval,
>  		     const struct traceeval_data *keys);
>  
> -int traceeval_query(struct traceeval *teval, const struct traceeval_data *keys,
> -		    const struct traceeval_data **results);
> +int traceeval_query_size(struct traceeval *teval, const struct traceeval_data *keys,
> +			 size_t nr_keys, const struct traceeval_data **results);
> +
> +#define traceeval_query(teval, keys, results)				\
> +	traceeval_query_size(teval, keys,				\
> +			     sizeof(keys) / sizeof(keys[0]), results);

That has an ';' at the end, and it causes failures for:

	if (traceeval_query(...) > 0)

(which I have in my trace-flames.c code).

I'll fix in v2.

-- Steve


  reply	other threads:[~2023-08-17 22:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 22:24 [PATCH 0/9] libtraceeval: Even more updates! Steven Rostedt
2023-08-17 22:24 ` [PATCH 1/9] libtraceeval: Add check for updates to know to recreate iter array Steven Rostedt
2023-08-24 19:41   ` Ross Zwisler
2023-08-17 22:24 ` [PATCH 2/9] libtraceeval: Add traceeval_iterator_query() Steven Rostedt
2023-08-17 22:50   ` Steven Rostedt
2023-08-20 18:18   ` Stevie Alvarez
2023-08-21 14:33     ` Steven Rostedt
2023-08-24 19:57   ` Ross Zwisler
2023-08-17 22:24 ` [PATCH 3/9] libtraceeval: Add traceeval_iterator_stat() Steven Rostedt
2023-08-24 20:07   ` Ross Zwisler
2023-08-17 22:24 ` [PATCH 4/9] libtraceeval: Add traceeval_iterator_remove() Steven Rostedt
2023-08-24 20:19   ` Ross Zwisler
2023-08-24 20:23     ` Ross Zwisler
2023-09-27  9:51       ` Steven Rostedt
2023-09-27  9:09     ` Steven Rostedt
2023-08-17 22:24 ` [PATCH 5/9] libtraceeval histogram: Add type to traceeval_data and make it a structure Steven Rostedt
2023-08-24 21:09   ` Ross Zwisler
2023-08-17 22:24 ` [PATCH 6/9] libtraceveal: Add type checks to traceeval_data vals and keys Steven Rostedt
2023-08-24 21:23   ` Ross Zwisler
2023-08-17 22:24 ` [PATCH 7/9] libtraceeval: Add size checks to insert and query functions Steven Rostedt
2023-08-17 22:39   ` Steven Rostedt [this message]
2023-08-17 22:24 ` [PATCH 8/9] libtraceeval: Add checks to traceeval_insert() and query() Steven Rostedt
2023-08-24 21:36   ` Ross Zwisler
2023-08-17 22:24 ` [PATCH 9/9] libtraceeval: Only do stats on values marked with the STAT flag Steven Rostedt
2023-08-24 22:02   ` Ross Zwisler

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=20230817183943.500343b4@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).