All of lore.kernel.org
 help / color / mirror / Atom feed
* [rostedt-trace:pmem-on-reserve-mem-fail 2/10] kernel/trace/ring_buffer.c:1943:34: warning: variable 'bmeta' set but not used
@ 2025-02-12  0:48 kernel test robot
  2025-02-12  0:54 ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2025-02-12  0:48 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: oe-kbuild-all

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-18  0:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12  0:48 [rostedt-trace:pmem-on-reserve-mem-fail 2/10] kernel/trace/ring_buffer.c:1943:34: warning: variable 'bmeta' set but not used kernel test robot
2025-02-12  0:54 ` 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

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.