tools lib traceevent: Use local variable 'field'
Use local variable 'field' to reduce typing. It is needed by later patch not to exceed 80 column. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1340757701-10711-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
		
					parent
					
						
							
								600da3cfe1
							
						
					
				
			
			
				commit
				
					
						b700807196
					
				
			
		
					 1 changed files with 11 additions and 8 deletions
				
			
		|  | @ -3214,6 +3214,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, | ||||||
| { | { | ||||||
| 	struct pevent *pevent = event->pevent; | 	struct pevent *pevent = event->pevent; | ||||||
| 	struct print_flag_sym *flag; | 	struct print_flag_sym *flag; | ||||||
|  | 	struct format_field *field; | ||||||
| 	unsigned long long val, fval; | 	unsigned long long val, fval; | ||||||
| 	unsigned long addr; | 	unsigned long addr; | ||||||
| 	char *str; | 	char *str; | ||||||
|  | @ -3228,27 +3229,29 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, | ||||||
| 		print_str_to_seq(s, format, len_arg, arg->atom.atom); | 		print_str_to_seq(s, format, len_arg, arg->atom.atom); | ||||||
| 		return; | 		return; | ||||||
| 	case PRINT_FIELD: | 	case PRINT_FIELD: | ||||||
| 		if (!arg->field.field) { | 		field = arg->field.field; | ||||||
| 			arg->field.field = pevent_find_any_field(event, arg->field.name); | 		if (!field) { | ||||||
| 			if (!arg->field.field) | 			field = pevent_find_any_field(event, arg->field.name); | ||||||
|  | 			if (!field) | ||||||
| 				die("field %s not found", arg->field.name); | 				die("field %s not found", arg->field.name); | ||||||
|  | 			arg->field.field = field; | ||||||
| 		} | 		} | ||||||
| 		/* Zero sized fields, mean the rest of the data */ | 		/* Zero sized fields, mean the rest of the data */ | ||||||
| 		len = arg->field.field->size ? : size - arg->field.field->offset; | 		len = field->size ? : size - field->offset; | ||||||
| 
 | 
 | ||||||
| 		/*
 | 		/*
 | ||||||
| 		 * Some events pass in pointers. If this is not an array | 		 * Some events pass in pointers. If this is not an array | ||||||
| 		 * and the size is the same as long_size, assume that it | 		 * and the size is the same as long_size, assume that it | ||||||
| 		 * is a pointer. | 		 * is a pointer. | ||||||
| 		 */ | 		 */ | ||||||
| 		if (!(arg->field.field->flags & FIELD_IS_ARRAY) && | 		if (!(field->flags & FIELD_IS_ARRAY) && | ||||||
| 		    arg->field.field->size == pevent->long_size) { | 		    field->size == pevent->long_size) { | ||||||
| 			addr = *(unsigned long *)(data + arg->field.field->offset); | 			addr = *(unsigned long *)(data + field->offset); | ||||||
| 			trace_seq_printf(s, "%lx", addr); | 			trace_seq_printf(s, "%lx", addr); | ||||||
| 			break; | 			break; | ||||||
| 		} | 		} | ||||||
| 		str = malloc_or_die(len + 1); | 		str = malloc_or_die(len + 1); | ||||||
| 		memcpy(str, data + arg->field.field->offset, len); | 		memcpy(str, data + field->offset, len); | ||||||
| 		str[len] = 0; | 		str[len] = 0; | ||||||
| 		print_str_to_seq(s, format, len_arg, str); | 		print_str_to_seq(s, format, len_arg, str); | ||||||
| 		free(str); | 		free(str); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Namhyung Kim
				Namhyung Kim