From: kernel test robot <lkp@intel.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [rostedt-trace:pmem-on-reserve-mem-fail 2/10] kernel/trace/ring_buffer.c:1943:34: warning: variable 'bmeta' set but not used
Date: Wed, 12 Feb 2025 08:48:01 +0800 [thread overview]
Message-ID: <202502120851.VulVvSyg-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git pmem-on-reserve-mem-fail
head: d877ee1b587be39c141df16a6f92efb0e90b30fd
commit: 04e1e84239466de5fe5310ddc8899b8b404a5ccc [2/10] ring-buffer: Add buffer meta data for persistent ring buffer
config: i386-buildonly-randconfig-002-20250212 (https://download.01.org/0day-ci/archive/20250212/202502120851.VulVvSyg-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250212/202502120851.VulVvSyg-lkp@intel.com/reproduce)
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/202502120851.VulVvSyg-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/trace/ring_buffer.c: In function 'rb_range_meta_init':
>> kernel/trace/ring_buffer.c:1943:34: warning: variable 'bmeta' set but not used [-Wunused-but-set-variable]
1943 | struct ring_buffer_meta *bmeta;
| ^~~~~
vim +/bmeta +1943 kernel/trace/ring_buffer.c
1939
1940 static void rb_range_meta_init(struct trace_buffer *buffer, int nr_pages)
1941 {
1942 struct ring_buffer_cpu_meta *meta;
> 1943 struct ring_buffer_meta *bmeta;
1944 unsigned long delta;
1945 void *subbuf;
1946 bool valid = false;
1947 int cpu;
1948 int i;
1949
1950 if (rb_meta_init(buffer))
1951 valid = true;
1952
1953 bmeta = buffer->meta;
1954
1955 for (cpu = 0; cpu < nr_cpu_ids; cpu++) {
1956 void *next_meta;
1957
1958 meta = rb_range_meta(buffer, nr_pages, cpu);
1959
1960 if (valid && rb_cpu_meta_valid(meta, cpu, buffer, nr_pages)) {
1961 /* Make the mappings match the current address */
1962 subbuf = rb_subbufs_from_meta(meta);
1963 delta = (unsigned long)subbuf - meta->first_buffer;
1964 meta->first_buffer += delta;
1965 meta->head_buffer += delta;
1966 meta->commit_buffer += delta;
1967 buffer->kaslr_addr = meta->kaslr_addr;
1968 continue;
1969 }
1970
1971 if (cpu < nr_cpu_ids - 1)
1972 next_meta = rb_range_meta(buffer, nr_pages, cpu + 1);
1973 else
1974 next_meta = (void *)buffer->range_addr_end;
1975
1976 memset(meta, 0, next_meta - (void *)meta);
1977
1978 meta->nr_subbufs = nr_pages + 1;
1979 meta->subbuf_size = PAGE_SIZE;
1980
1981 subbuf = rb_subbufs_from_meta(meta);
1982
1983 meta->first_buffer = (unsigned long)subbuf;
1984 rb_meta_init_text_addr(meta);
1985
1986 /*
1987 * The buffers[] array holds the order of the sub-buffers
1988 * that are after the meta data. The sub-buffers may
1989 * be swapped out when read and inserted into a different
1990 * location of the ring buffer. Although their addresses
1991 * remain the same, the buffers[] array contains the
1992 * index into the sub-buffers holding their actual order.
1993 */
1994 for (i = 0; i < meta->nr_subbufs; i++) {
1995 meta->buffers[i] = i;
1996 rb_init_page(subbuf);
1997 subbuf += meta->subbuf_size;
1998 }
1999 }
2000 }
2001
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-02-12 0:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 0:48 kernel test robot [this message]
2025-02-12 0:54 ` [rostedt-trace:pmem-on-reserve-mem-fail 2/10] kernel/trace/ring_buffer.c:1943:34: warning: variable 'bmeta' set but not used Steven Rostedt
2025-02-13 3:05 ` Philip Li
2025-02-13 16:42 ` Steven Rostedt
2025-02-14 3:24 ` Philip Li
2025-02-17 16:14 ` Steven Rostedt
2025-02-18 0:33 ` Philip Li
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=202502120851.VulVvSyg-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rostedt@goodmis.org \
/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.