File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,17 @@ static int read_tracing_file_to_stdout(const char *name)
169
169
return ret ;
170
170
}
171
171
172
+ static int write_tracing_file_int (const char * name , int value )
173
+ {
174
+ char buf [16 ];
175
+
176
+ snprintf (buf , sizeof (buf ), "%d" , value );
177
+ if (write_tracing_file (name , buf ) < 0 )
178
+ return -1 ;
179
+
180
+ return 0 ;
181
+ }
182
+
172
183
static int reset_tracing_cpu (void );
173
184
static void reset_tracing_filters (void );
174
185
@@ -299,8 +310,6 @@ static void reset_tracing_filters(void)
299
310
300
311
static int set_tracing_depth (struct perf_ftrace * ftrace )
301
312
{
302
- char buf [16 ];
303
-
304
313
if (ftrace -> graph_depth == 0 )
305
314
return 0 ;
306
315
@@ -309,9 +318,7 @@ static int set_tracing_depth(struct perf_ftrace *ftrace)
309
318
return -1 ;
310
319
}
311
320
312
- snprintf (buf , sizeof (buf ), "%d" , ftrace -> graph_depth );
313
-
314
- if (write_tracing_file ("max_graph_depth" , buf ) < 0 )
321
+ if (write_tracing_file_int ("max_graph_depth" , ftrace -> graph_depth ) < 0 )
315
322
return -1 ;
316
323
317
324
return 0 ;
You can’t perform that action at this time.
0 commit comments