Skip to content

Commit e46a25b

Browse files
peffgitster
authored andcommitted
trace2: mark unused us_elapsed_absolute parameters
Many trace2 targets ignore the absolute elapsed time parameters. However, the virtual interface needs to retain the parameter since it is used by others (e.g., the perf target). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 71006d7 commit e46a25b

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

trace2/tr2_tgt_event.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static void fn_alias_fl(const char *file, int line, const char *alias,
335335
}
336336

337337
static void fn_child_start_fl(const char *file, int line,
338-
uint64_t us_elapsed_absolute,
338+
uint64_t us_elapsed_absolute UNUSED,
339339
const struct child_process *cmd)
340340
{
341341
const char *event_name = "child_start";
@@ -367,7 +367,8 @@ static void fn_child_start_fl(const char *file, int line,
367367
}
368368

369369
static void fn_child_exit_fl(const char *file, int line,
370-
uint64_t us_elapsed_absolute, int cid, int pid,
370+
uint64_t us_elapsed_absolute UNUSED,
371+
int cid, int pid,
371372
int code, uint64_t us_elapsed_child)
372373
{
373374
const char *event_name = "child_exit";
@@ -388,7 +389,8 @@ static void fn_child_exit_fl(const char *file, int line,
388389
}
389390

390391
static void fn_child_ready_fl(const char *file, int line,
391-
uint64_t us_elapsed_absolute, int cid, int pid,
392+
uint64_t us_elapsed_absolute UNUSED,
393+
int cid, int pid,
392394
const char *ready, uint64_t us_elapsed_child)
393395
{
394396
const char *event_name = "child_ready";
@@ -409,7 +411,7 @@ static void fn_child_ready_fl(const char *file, int line,
409411
}
410412

411413
static void fn_thread_start_fl(const char *file, int line,
412-
uint64_t us_elapsed_absolute)
414+
uint64_t us_elapsed_absolute UNUSED)
413415
{
414416
const char *event_name = "thread_start";
415417
struct json_writer jw = JSON_WRITER_INIT;
@@ -423,7 +425,7 @@ static void fn_thread_start_fl(const char *file, int line,
423425
}
424426

425427
static void fn_thread_exit_fl(const char *file, int line,
426-
uint64_t us_elapsed_absolute,
428+
uint64_t us_elapsed_absolute UNUSED,
427429
uint64_t us_elapsed_thread)
428430
{
429431
const char *event_name = "thread_exit";
@@ -439,7 +441,8 @@ static void fn_thread_exit_fl(const char *file, int line,
439441
jw_release(&jw);
440442
}
441443

442-
static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
444+
static void fn_exec_fl(const char *file, int line,
445+
uint64_t us_elapsed_absolute UNUSED,
443446
int exec_id, const char *exe, const char **argv)
444447
{
445448
const char *event_name = "exec";
@@ -460,8 +463,8 @@ static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
460463
}
461464

462465
static void fn_exec_result_fl(const char *file, int line,
463-
uint64_t us_elapsed_absolute, int exec_id,
464-
int code)
466+
uint64_t us_elapsed_absolute UNUSED,
467+
int exec_id, int code)
465468
{
466469
const char *event_name = "exec_result";
467470
struct json_writer jw = JSON_WRITER_INIT;
@@ -511,7 +514,7 @@ static void fn_repo_fl(const char *file, int line,
511514
}
512515

513516
static void fn_region_enter_printf_va_fl(const char *file, int line,
514-
uint64_t us_elapsed_absolute,
517+
uint64_t us_elapsed_absolute UNUSED,
515518
const char *category,
516519
const char *label,
517520
const struct repository *repo,
@@ -538,7 +541,7 @@ static void fn_region_enter_printf_va_fl(const char *file, int line,
538541
}
539542

540543
static void fn_region_leave_printf_va_fl(
541-
const char *file, int line, uint64_t us_elapsed_absolute,
544+
const char *file, int line, uint64_t us_elapsed_absolute UNUSED,
542545
uint64_t us_elapsed_region, const char *category, const char *label,
543546
const struct repository *repo, const char *fmt, va_list ap)
544547
{

trace2/tr2_tgt_normal.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void fn_version_fl(const char *file, int line)
8686
}
8787

8888
static void fn_start_fl(const char *file, int line,
89-
uint64_t us_elapsed_absolute, const char **argv)
89+
uint64_t us_elapsed_absolute UNUSED, const char **argv)
9090
{
9191
struct strbuf buf_payload = STRBUF_INIT;
9292

@@ -215,7 +215,7 @@ static void fn_alias_fl(const char *file, int line, const char *alias,
215215
}
216216

217217
static void fn_child_start_fl(const char *file, int line,
218-
uint64_t us_elapsed_absolute,
218+
uint64_t us_elapsed_absolute UNUSED,
219219
const struct child_process *cmd)
220220
{
221221
struct strbuf buf_payload = STRBUF_INIT;
@@ -243,7 +243,8 @@ static void fn_child_start_fl(const char *file, int line,
243243
}
244244

245245
static void fn_child_exit_fl(const char *file, int line,
246-
uint64_t us_elapsed_absolute, int cid, int pid,
246+
uint64_t us_elapsed_absolute UNUSED,
247+
int cid, int pid,
247248
int code, uint64_t us_elapsed_child)
248249
{
249250
struct strbuf buf_payload = STRBUF_INIT;
@@ -256,7 +257,8 @@ static void fn_child_exit_fl(const char *file, int line,
256257
}
257258

258259
static void fn_child_ready_fl(const char *file, int line,
259-
uint64_t us_elapsed_absolute, int cid, int pid,
260+
uint64_t us_elapsed_absolute UNUSED,
261+
int cid, int pid,
260262
const char *ready, uint64_t us_elapsed_child)
261263
{
262264
struct strbuf buf_payload = STRBUF_INIT;
@@ -268,7 +270,8 @@ static void fn_child_ready_fl(const char *file, int line,
268270
strbuf_release(&buf_payload);
269271
}
270272

271-
static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
273+
static void fn_exec_fl(const char *file, int line,
274+
uint64_t us_elapsed_absolute UNUSED,
272275
int exec_id, const char *exe, const char **argv)
273276
{
274277
struct strbuf buf_payload = STRBUF_INIT;
@@ -284,8 +287,8 @@ static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
284287
}
285288

286289
static void fn_exec_result_fl(const char *file, int line,
287-
uint64_t us_elapsed_absolute, int exec_id,
288-
int code)
290+
uint64_t us_elapsed_absolute UNUSED,
291+
int exec_id, int code)
289292
{
290293
struct strbuf buf_payload = STRBUF_INIT;
291294

@@ -321,7 +324,8 @@ static void fn_repo_fl(const char *file, int line,
321324
}
322325

323326
static void fn_printf_va_fl(const char *file, int line,
324-
uint64_t us_elapsed_absolute, const char *fmt,
327+
uint64_t us_elapsed_absolute UNUSED,
328+
const char *fmt,
325329
va_list ap)
326330
{
327331
struct strbuf buf_payload = STRBUF_INIT;

0 commit comments

Comments
 (0)