All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Kris Van Hees <kris.van.hees@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] usdt; perform __ to - conversion for usdt and prov notes
Date: Fri, 10 Oct 2025 23:47:19 -0400	[thread overview]
Message-ID: <aOnTR+13ITNIEHeb@oracle.com> (raw)
In-Reply-To: <SJ0PR10MB5672738898FBCFFE5C13ADEAC2ECA@SJ0PR10MB5672.namprd10.prod.outlook.com>

Nevermind - patch withdrawn

On Fri, Oct 10, 2025 at 11:35:30PM -0400, Kris Van Hees wrote:
> The __ to - conversion was only done for usdt notes.  It needs to be
> done for both usdt and prov notes because they both contain probe
> names that may need converting.
> 
> Reported-by: Ruud van der Pas <ruud.vanderpas@oracle.com>
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
>  libcommon/usdt_parser_notes.c | 40 +++++++++++++++++++++--------------
>  1 file changed, 24 insertions(+), 16 deletions(-)
> 
> diff --git a/libcommon/usdt_parser_notes.c b/libcommon/usdt_parser_notes.c
> index c98c9fb0..a8b46e65 100644
> --- a/libcommon/usdt_parser_notes.c
> +++ b/libcommon/usdt_parser_notes.c
> @@ -293,6 +293,27 @@ strarray_size(uint8_t cnt, const char *str, const char *end, size_t skip)
>  	return p - str;
>  }
>  
> +/*
> + * If the probe name has encoded hyphens, perform in-place changing from "__"
> + * into "-".
> + */
> +static void
> +fix_probe_name(const char *prb, const char *end)
> +{
> +	if (strstr(prb, "__") != NULL) {
> +		char		*q;
> +		const char	*s = prb;
> +
> +		for (q = (char *)s; s < end; s++, q++) {
> +			if (s[0] == '_' && s[1] == '_') {
> +				*q = '-';
> +				s++;
> +			} else if (s > q)
> +				*q = *s;
> +		}
> +	}
> +}
> +
>  static int
>  parse_prov_note(int out, dof_helper_t *dhp, usdt_data_t *data,
>  		usdt_note_t *note)
> @@ -353,6 +374,8 @@ parse_prov_note(int out, dof_helper_t *dhp, usdt_data_t *data,
>  			return -1;
>  		}
>  
> +		fix_probe_name(prbt.prb, p);
> +
>  		if ((prp = dt_htab_lookup(pvp->pmap, &prbt)) == NULL) {
>  			if ((prp = malloc(sizeof(dt_probe_t))) == NULL) {
>  				usdt_error(out, ENOMEM, "Failed to allocate probe");
> @@ -471,22 +494,7 @@ parse_usdt_note(int out, dof_helper_t *dhp, usdt_data_t *data,
>  	}
>  	prbt.off = off;
>  
> -	/*
> -	 * If the probe name has encoded hyphens, perform in-place changing
> -	 * from "__" into "-".
> -	 */
> -	if (strstr(prbt.prb, "__") != NULL) {
> -		char		*q;
> -		const char	*s = prbt.prb, *e = p;
> -
> -		for (q = (char *)s; s < e; s++, q++) {
> -			if (s[0] == '_' && s[1] == '_') {
> -				*q = '-';
> -				s++;
> -			} else if (s > q)
> -				*q = *s;
> -		}
> -	}
> +	fix_probe_name(prbt.prb, p);
>  
>  	if ((prp = dt_htab_lookup(prbmap, &prbt)) == NULL) {
>  		if ((prp = malloc(sizeof(dt_probe_t))) == NULL) {
> -- 
> 2.43.5
> 

      reply	other threads:[~2025-10-11  3:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11  3:35 [PATCH] usdt; perform __ to - conversion for usdt and prov notes Kris Van Hees
2025-10-11  3:47 ` Kris Van Hees [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=aOnTR+13ITNIEHeb@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    /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.