All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ryan Chung <seokwoo.chung130@gmail.com>,
	rostedt@goodmis.org, mhiramat@kernel.org,
	mathieu.desnoyer@efficios.com
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev,
	Ryan Chung <seokwoo.chung130@gmail.com>
Subject: Re: [PATCH] trace/trace_fprobe.c: TODO: handle filter, nofilter or symbol list
Date: Sun, 17 Aug 2025 12:28:09 +0800	[thread overview]
Message-ID: <202508171256.CSm9DAkb-lkp@intel.com> (raw)
In-Reply-To: <20250812162101.5981-1-seokwoo.chung130@gmail.com>

Hi Ryan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on v6.16]
[also build test WARNING on linus/master next-20250815]
[cannot apply to trace/for-next v6.17-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ryan-Chung/trace-trace_fprobe-c-TODO-handle-filter-nofilter-or-symbol-list/20250813-002748
base:   v6.16
patch link:    https://lore.kernel.org/r/20250812162101.5981-1-seokwoo.chung130%40gmail.com
patch subject: [PATCH] trace/trace_fprobe.c: TODO: handle filter, nofilter or symbol list
config: s390-randconfig-r073-20250817 (https://download.01.org/0day-ci/archive/20250817/202508171256.CSm9DAkb-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 8.5.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508171256.CSm9DAkb-lkp@intel.com/

smatch warnings:
kernel/trace/trace_fprobe.c:768 __register_trace_fprobe() warn: inconsistent indenting

vim +768 kernel/trace/trace_fprobe.c

   732	
   733	/* Internal register function - just handle fprobe and flags */
   734	static int __register_trace_fprobe(struct trace_fprobe *tf)
   735	{
   736		int i, ret;
   737	
   738		/* Should we need new LOCKDOWN flag for fprobe? */
   739		ret = security_locked_down(LOCKDOWN_KPROBES);
   740		if (ret)
   741			return ret;
   742	
   743		if (trace_fprobe_is_registered(tf))
   744			return -EINVAL;
   745	
   746		for (i = 0; i < tf->tp.nr_args; i++) {
   747			ret = traceprobe_update_arg(&tf->tp.args[i]);
   748			if (ret)
   749				return ret;
   750		}
   751	
   752		/* Set/clear disabled flag according to tp->flag */
   753		if (trace_probe_is_enabled(&tf->tp))
   754			tf->fp.flags &= ~FPROBE_FL_DISABLED;
   755		else
   756			tf->fp.flags |= FPROBE_FL_DISABLED;
   757	
   758		if (trace_fprobe_is_tracepoint(tf)) {
   759	
   760			/* This tracepoint is not loaded yet */
   761			if (tf->tpoint == TRACEPOINT_STUB)
   762				return 0;
   763	
   764			return __regsiter_tracepoint_fprobe(tf);
   765		}
   766	
   767	    /* Parse tf->symbol */
 > 768	    {
   769	        char *spec, *bang, *p;
   770	        int n = 0, w = 0, j, rc;
   771	        char **syms = NULL;
   772	
   773	        spec = kstrdup(tf->symbol, GFP_KERNEL);
   774	        if (!spec)
   775	            return -ENOMEM;
   776	
   777	        /* If a '!' exists, treat it as single symbol + filter */
   778	        bang = strchr(spec, '!');
   779	        if (bang) {
   780	            char *sym, *flt;
   781	
   782	            *bang = '\0';
   783	            sym = strim(spec);
   784	            flt = strim(bang + 1);
   785	
   786	            if (!*sym || !*flt) {
   787	                kfree(spec);
   788	                return -EINVAL; /* reject empty symbol/filter */
   789	            }
   790	
   791	            rc = register_fprobe(&tf->fp, sym, flt);
   792	            kfree(spec);
   793	            return rc;
   794	        }
   795	
   796	        /* Comma list (or single symbol without '!') */
   797	        /* First pass: count non-empty tokens */
   798	        p = spec;
   799	        while (p) {
   800	            char *tok = strsep(&p, ",");
   801	            if (tok && *strim(tok))
   802	                n++;
   803	        }
   804	
   805	        if (n == 0){
   806	            kfree(spec);
   807	            return -EINVAL;
   808	        }
   809	
   810	        /* Allocate array for pointers into spec (callee copies/consumes) */
   811	        syms = kcalloc(n, sizeof(*syms), GFP_KERNEL);
   812	        if (!syms) {
   813	            kfree(spec);
   814	            return -ENOMEM;
   815	        }
   816	
   817	        /* Second pass: fill, skipping empties */
   818	        p = spec;
   819	        while (p) {
   820	            char *tok = strsep(&p, ",");
   821	            char *s;
   822	
   823	            if (!tok)
   824	                break;
   825	            s = strim(tok);
   826	            if (!*s)
   827	                continue;
   828	            syms[w++] = s; 
   829	        }
   830	        
   831	        /* Dedup in-place */
   832	        for (i = 0; i < w; i++){
   833	            if (!syms[i])
   834	                continue;
   835	            for (j = i + 1; j < w; j++) {
   836	                if (syms[j] && !strcmp(syms[i], syms[j]))
   837	                    syms[j] = NULL;
   838	            }
   839	        }
   840	
   841	        /* Compact */
   842	        for (i = 0, j = 0; i < w; i++) {
   843	            if (syms[i])
   844	                syms[j++] = syms[i];
   845	        }
   846	        w = j;
   847	
   848	        /* After dedup, ensure we still have at least one symbol */
   849	        if (w == 0){
   850	            kfree(syms);
   851	            kfree(spec);
   852	            return -EINVAL;
   853	        }
   854	
   855	        /* Register list or single symbol, using the existing bulk API */
   856	        if (w == 1)
   857	            rc = register_fprobe(&tf->fp, syms[0], NULL);
   858	        else
   859	            rc = register_fprobe_syms(&tf->fp, (const char **)syms, w);
   860	
   861	        kfree(syms);
   862	        kfree(spec);
   863	        return rc;
   864	    }
   865	}
   866	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2025-08-17  4:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 16:21 [PATCH] trace/trace_fprobe.c: TODO: handle filter, nofilter or symbol list Ryan Chung
2025-08-12 18:03 ` Steven Rostedt
2025-08-13 13:21   ` Ryan Chung
2025-08-14  3:15 ` Masami Hiramatsu
2025-08-19 16:37   ` Ryan Chung
2025-08-17  4:28 ` kernel test robot [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=202508171256.CSm9DAkb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyer@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=seokwoo.chung130@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.