[linux-next:master 7031/9183] kernel/trace/trace_events_synth.c:567 trace_event_raw_event_synth() warn: inconsistent indenting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ae0c77e1bc6963c67c6c09e8c72959fcb1ed8d5f
commit: 00cf3d672a9dd409418647e9f98784c339c3ff63 [7031/9183] tracing: Allow synthetic events to pass around stacktraces
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20230130/202301302110.mEtNwkBD-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>

smatch warnings:
kernel/trace/trace_events_synth.c:567 trace_event_raw_event_synth() warn: inconsistent indenting

vim +567 kernel/trace/trace_events_synth.c

   514	
   515	static notrace void trace_event_raw_event_synth(void *__data,
   516							u64 *var_ref_vals,
   517							unsigned int *var_ref_idx)
   518	{
   519		unsigned int i, n_u64, val_idx, len, data_size = 0;
   520		struct trace_event_file *trace_file = __data;
   521		struct synth_trace_event *entry;
   522		struct trace_event_buffer fbuffer;
   523		struct trace_buffer *buffer;
   524		struct synth_event *event;
   525		int fields_size = 0;
   526	
   527		event = trace_file->event_call->data;
   528	
   529		if (trace_trigger_soft_disabled(trace_file))
   530			return;
   531	
   532		fields_size = event->n_u64 * sizeof(u64);
   533	
   534		for (i = 0; i < event->n_dynamic_fields; i++) {
   535			unsigned int field_pos = event->dynamic_fields[i]->field_pos;
   536			char *str_val;
   537	
   538			val_idx = var_ref_idx[field_pos];
   539			str_val = (char *)(long)var_ref_vals[val_idx];
   540	
   541			len = kern_fetch_store_strlen((unsigned long)str_val);
   542	
   543			fields_size += len;
   544		}
   545	
   546		/*
   547		 * Avoid ring buffer recursion detection, as this event
   548		 * is being performed within another event.
   549		 */
   550		buffer = trace_file->tr->array_buffer.buffer;
   551		ring_buffer_nest_start(buffer);
   552	
   553		entry = trace_event_buffer_reserve(&fbuffer, trace_file,
   554						   sizeof(*entry) + fields_size);
   555		if (!entry)
   556			goto out;
   557	
   558		for (i = 0, n_u64 = 0; i < event->n_fields; i++) {
   559			val_idx = var_ref_idx[i];
   560			if (event->fields[i]->is_string) {
   561				char *str_val = (char *)(long)var_ref_vals[val_idx];
   562	
   563				len = trace_string(entry, event, str_val,
   564						   event->fields[i]->is_dynamic,
   565						   data_size, &n_u64);
   566				data_size += len; /* only dynamic string increments */
 > 567			} if (event->fields[i]->is_stack) {
   568			        long *stack = (long *)(long)var_ref_vals[val_idx];
   569	
   570				len = trace_stack(entry, event, stack,
   571						   data_size, &n_u64);
   572				data_size += len;
   573			} else {
   574				struct synth_field *field = event->fields[i];
   575				u64 val = var_ref_vals[val_idx];
   576	
   577				switch (field->size) {
   578				case 1:
   579					*(u8 *)&entry->fields[n_u64] = (u8)val;
   580					break;
   581	
   582				case 2:
   583					*(u16 *)&entry->fields[n_u64] = (u16)val;
   584					break;
   585	
   586				case 4:
   587					*(u32 *)&entry->fields[n_u64] = (u32)val;
   588					break;
   589	
   590				default:
   591					entry->fields[n_u64] = val;
   592					break;
   593				}
   594				n_u64++;
   595			}
   596		}
   597	
   598		trace_event_buffer_commit(&fbuffer);
   599	out:
   600		ring_buffer_nest_end(buffer);
   601	}
   602	

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux