]> git.ipfire.org Git - thirdparty/git.git/blame - trace2/tr2_tgt_event.c
Merge branch 'rs/bisect-start-leakfix' into maint-2.38
[thirdparty/git.git] / trace2 / tr2_tgt_event.c
CommitLineData
ee4512ed
JH
1#include "cache.h"
2#include "config.h"
3#include "json-writer.h"
4#include "run-command.h"
5#include "version.h"
6#include "trace2/tr2_dst.h"
7#include "trace2/tr2_tbuf.h"
8#include "trace2/tr2_sid.h"
bce9db6d 9#include "trace2/tr2_sysenv.h"
ee4512ed
JH
10#include "trace2/tr2_tgt.h"
11#include "trace2/tr2_tls.h"
12
4996e0b0
ÆAB
13static struct tr2_dst tr2dst_event = {
14 .sysenv_var = TR2_SYSENV_EVENT,
15};
ee4512ed
JH
16
17/*
87db61a4
JS
18 * The version number of the JSON data generated by the EVENT target in this
19 * source file. The version should be incremented if new event types are added,
20 * if existing fields are removed, or if there are significant changes in
21 * interpretation of existing events or fields. Smaller changes, such as adding
22 * a new field to an existing event, do not require an increment to the EVENT
23 * format version.
ee4512ed 24 */
04480e67 25#define TR2_EVENT_VERSION "3"
ee4512ed
JH
26
27/*
28 * Region nesting limit for messages written to the event target.
29 *
30 * The "region_enter" and "region_leave" messages (especially recursive
31 * messages such as those produced while diving the worktree or index)
32 * are primarily intended for the performance target during debugging.
33 *
34 * Some of the outer-most messages, however, may be of interest to the
bce9db6d
JH
35 * event target. Use the TR2_SYSENV_EVENT_NESTING setting to increase
36 * region details in the event target.
ee4512ed 37 */
bce9db6d 38static int tr2env_event_max_nesting_levels = 2;
ee4512ed
JH
39
40/*
bce9db6d 41 * Use the TR2_SYSENV_EVENT_BRIEF to omit the <time>, <file>, and
ee4512ed
JH
42 * <line> fields from most events.
43 */
bce9db6d 44static int tr2env_event_be_brief;
ee4512ed
JH
45
46static int fn_init(void)
47{
48 int want = tr2_dst_trace_want(&tr2dst_event);
bce9db6d 49 int max_nesting;
ee4512ed 50 int want_brief;
bce9db6d
JH
51 const char *nesting;
52 const char *brief;
ee4512ed
JH
53
54 if (!want)
55 return want;
56
bce9db6d
JH
57 nesting = tr2_sysenv_get(TR2_SYSENV_EVENT_NESTING);
58 if (nesting && *nesting && ((max_nesting = atoi(nesting)) > 0))
59 tr2env_event_max_nesting_levels = max_nesting;
ee4512ed 60
bce9db6d
JH
61 brief = tr2_sysenv_get(TR2_SYSENV_EVENT_BRIEF);
62 if (brief && *brief &&
63 ((want_brief = git_parse_maybe_bool(brief)) != -1))
64 tr2env_event_be_brief = want_brief;
ee4512ed
JH
65
66 return want;
67}
68
69static void fn_term(void)
70{
71 tr2_dst_trace_disable(&tr2dst_event);
72}
73
74/*
75 * Append common key-value pairs to the currently open JSON object.
76 * "event:"<event_name>"
77 * "sid":"<sid>"
78 * "thread":"<thread_name>"
79 * "time":"<time>"
80 * "file":"<filename>"
81 * "line":<line_number>
82 * "repo":<repo_id>
83 */
84static void event_fmt_prepare(const char *event_name, const char *file,
85 int line, const struct repository *repo,
86 struct json_writer *jw)
87{
88 struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
89 struct tr2_tbuf tb_now;
90
91 jw_object_string(jw, "event", event_name);
92 jw_object_string(jw, "sid", tr2_sid_get());
93 jw_object_string(jw, "thread", ctx->thread_name.buf);
94
95 /*
96 * In brief mode, only emit <time> on these 2 event types.
97 */
bce9db6d 98 if (!tr2env_event_be_brief || !strcmp(event_name, "version") ||
ee4512ed 99 !strcmp(event_name, "atexit")) {
bad229ae 100 tr2_tbuf_utc_datetime_extended(&tb_now);
ee4512ed
JH
101 jw_object_string(jw, "time", tb_now.buf);
102 }
103
bce9db6d 104 if (!tr2env_event_be_brief && file && *file) {
ee4512ed
JH
105 jw_object_string(jw, "file", file);
106 jw_object_intmax(jw, "line", line);
107 }
108
109 if (repo)
110 jw_object_intmax(jw, "repo", repo->trace2_repo_id);
111}
112
87db61a4
JS
113static void fn_too_many_files_fl(const char *file, int line)
114{
115 const char *event_name = "too_many_files";
116 struct json_writer jw = JSON_WRITER_INIT;
117
118 jw_object_begin(&jw, 0);
119 event_fmt_prepare(event_name, file, line, NULL, &jw);
120 jw_end(&jw);
121
122 tr2_dst_write_line(&tr2dst_event, &jw.json);
123 jw_release(&jw);
124}
125
ee4512ed
JH
126static void fn_version_fl(const char *file, int line)
127{
128 const char *event_name = "version";
129 struct json_writer jw = JSON_WRITER_INIT;
130
131 jw_object_begin(&jw, 0);
132 event_fmt_prepare(event_name, file, line, NULL, &jw);
133 jw_object_string(&jw, "evt", TR2_EVENT_VERSION);
134 jw_object_string(&jw, "exe", git_version_string);
135 jw_end(&jw);
136
137 tr2_dst_write_line(&tr2dst_event, &jw.json);
138 jw_release(&jw);
87db61a4
JS
139
140 if (tr2dst_event.too_many_files)
141 fn_too_many_files_fl(file, line);
ee4512ed
JH
142}
143
39f43177
JH
144static void fn_start_fl(const char *file, int line,
145 uint64_t us_elapsed_absolute, const char **argv)
ee4512ed
JH
146{
147 const char *event_name = "start";
148 struct json_writer jw = JSON_WRITER_INIT;
39f43177 149 double t_abs = (double)us_elapsed_absolute / 1000000.0;
ee4512ed
JH
150
151 jw_object_begin(&jw, 0);
152 event_fmt_prepare(event_name, file, line, NULL, &jw);
39f43177 153 jw_object_double(&jw, "t_abs", 6, t_abs);
ee4512ed
JH
154 jw_object_inline_begin_array(&jw, "argv");
155 jw_array_argv(&jw, argv);
156 jw_end(&jw);
157 jw_end(&jw);
158
159 tr2_dst_write_line(&tr2dst_event, &jw.json);
160 jw_release(&jw);
161}
162
163static void fn_exit_fl(const char *file, int line, uint64_t us_elapsed_absolute,
164 int code)
165{
166 const char *event_name = "exit";
167 struct json_writer jw = JSON_WRITER_INIT;
168 double t_abs = (double)us_elapsed_absolute / 1000000.0;
169
170 jw_object_begin(&jw, 0);
171 event_fmt_prepare(event_name, file, line, NULL, &jw);
172 jw_object_double(&jw, "t_abs", 6, t_abs);
173 jw_object_intmax(&jw, "code", code);
174 jw_end(&jw);
175
176 tr2_dst_write_line(&tr2dst_event, &jw.json);
177 jw_release(&jw);
178}
179
180static void fn_signal(uint64_t us_elapsed_absolute, int signo)
181{
182 const char *event_name = "signal";
183 struct json_writer jw = JSON_WRITER_INIT;
184 double t_abs = (double)us_elapsed_absolute / 1000000.0;
185
186 jw_object_begin(&jw, 0);
187 event_fmt_prepare(event_name, __FILE__, __LINE__, NULL, &jw);
188 jw_object_double(&jw, "t_abs", 6, t_abs);
189 jw_object_intmax(&jw, "signo", signo);
190 jw_end(&jw);
191
192 tr2_dst_write_line(&tr2dst_event, &jw.json);
193 jw_release(&jw);
194}
195
196static void fn_atexit(uint64_t us_elapsed_absolute, int code)
197{
198 const char *event_name = "atexit";
199 struct json_writer jw = JSON_WRITER_INIT;
200 double t_abs = (double)us_elapsed_absolute / 1000000.0;
201
202 jw_object_begin(&jw, 0);
203 event_fmt_prepare(event_name, __FILE__, __LINE__, NULL, &jw);
204 jw_object_double(&jw, "t_abs", 6, t_abs);
205 jw_object_intmax(&jw, "code", code);
206 jw_end(&jw);
207
208 tr2_dst_write_line(&tr2dst_event, &jw.json);
209 jw_release(&jw);
210}
211
212static void maybe_add_string_va(struct json_writer *jw, const char *field_name,
213 const char *fmt, va_list ap)
214{
ad006fe4 215 if (fmt && *fmt) {
ee4512ed
JH
216 va_list copy_ap;
217 struct strbuf buf = STRBUF_INIT;
218
219 va_copy(copy_ap, ap);
220 strbuf_vaddf(&buf, fmt, copy_ap);
221 va_end(copy_ap);
222
223 jw_object_string(jw, field_name, buf.buf);
224 strbuf_release(&buf);
225 return;
226 }
ee4512ed
JH
227}
228
229static void fn_error_va_fl(const char *file, int line, const char *fmt,
230 va_list ap)
231{
232 const char *event_name = "error";
233 struct json_writer jw = JSON_WRITER_INIT;
234
235 jw_object_begin(&jw, 0);
236 event_fmt_prepare(event_name, file, line, NULL, &jw);
237 maybe_add_string_va(&jw, "msg", fmt, ap);
238 /*
239 * Also emit the format string as a field in case
240 * post-processors want to aggregate common error
241 * messages by type without argument fields (such
242 * as pathnames or branch names) cluttering it up.
243 */
244 if (fmt && *fmt)
245 jw_object_string(&jw, "fmt", fmt);
246 jw_end(&jw);
247
248 tr2_dst_write_line(&tr2dst_event, &jw.json);
249 jw_release(&jw);
250}
251
252static void fn_command_path_fl(const char *file, int line, const char *pathname)
253{
254 const char *event_name = "cmd_path";
255 struct json_writer jw = JSON_WRITER_INIT;
256
257 jw_object_begin(&jw, 0);
258 event_fmt_prepare(event_name, file, line, NULL, &jw);
259 jw_object_string(&jw, "path", pathname);
260 jw_end(&jw);
261
262 tr2_dst_write_line(&tr2dst_event, &jw.json);
263 jw_release(&jw);
264}
265
2f732bf1
ES
266static void fn_command_ancestry_fl(const char *file, int line, const char **parent_names)
267{
268 const char *event_name = "cmd_ancestry";
269 const char *parent_name = NULL;
270 struct json_writer jw = JSON_WRITER_INIT;
271
272 jw_object_begin(&jw, 0);
273 event_fmt_prepare(event_name, file, line, NULL, &jw);
274 jw_object_inline_begin_array(&jw, "ancestry");
275
276 while ((parent_name = *parent_names++))
277 jw_array_string(&jw, parent_name);
278
279 jw_end(&jw); /* 'ancestry' array */
280 jw_end(&jw); /* event object */
281
282 tr2_dst_write_line(&tr2dst_event, &jw.json);
283 jw_release(&jw);
284}
285
ee4512ed
JH
286static void fn_command_name_fl(const char *file, int line, const char *name,
287 const char *hierarchy)
288{
289 const char *event_name = "cmd_name";
290 struct json_writer jw = JSON_WRITER_INIT;
291
292 jw_object_begin(&jw, 0);
293 event_fmt_prepare(event_name, file, line, NULL, &jw);
294 jw_object_string(&jw, "name", name);
295 if (hierarchy && *hierarchy)
296 jw_object_string(&jw, "hierarchy", hierarchy);
297 jw_end(&jw);
298
299 tr2_dst_write_line(&tr2dst_event, &jw.json);
300 jw_release(&jw);
301}
302
303static void fn_command_mode_fl(const char *file, int line, const char *mode)
304{
305 const char *event_name = "cmd_mode";
306 struct json_writer jw = JSON_WRITER_INIT;
307
308 jw_object_begin(&jw, 0);
309 event_fmt_prepare(event_name, file, line, NULL, &jw);
310 jw_object_string(&jw, "name", mode);
311 jw_end(&jw);
312
313 tr2_dst_write_line(&tr2dst_event, &jw.json);
314 jw_release(&jw);
315}
316
317static void fn_alias_fl(const char *file, int line, const char *alias,
318 const char **argv)
319{
320 const char *event_name = "alias";
321 struct json_writer jw = JSON_WRITER_INIT;
322
323 jw_object_begin(&jw, 0);
324 event_fmt_prepare(event_name, file, line, NULL, &jw);
325 jw_object_string(&jw, "alias", alias);
326 jw_object_inline_begin_array(&jw, "argv");
327 jw_array_argv(&jw, argv);
328 jw_end(&jw);
329 jw_end(&jw);
330
331 tr2_dst_write_line(&tr2dst_event, &jw.json);
332 jw_release(&jw);
333}
334
335static void fn_child_start_fl(const char *file, int line,
336 uint64_t us_elapsed_absolute,
337 const struct child_process *cmd)
338{
339 const char *event_name = "child_start";
340 struct json_writer jw = JSON_WRITER_INIT;
341
342 jw_object_begin(&jw, 0);
343 event_fmt_prepare(event_name, file, line, NULL, &jw);
344 jw_object_intmax(&jw, "child_id", cmd->trace2_child_id);
345 if (cmd->trace2_hook_name) {
346 jw_object_string(&jw, "child_class", "hook");
347 jw_object_string(&jw, "hook_name", cmd->trace2_hook_name);
348 } else {
349 const char *child_class =
350 cmd->trace2_child_class ? cmd->trace2_child_class : "?";
351 jw_object_string(&jw, "child_class", child_class);
352 }
353 if (cmd->dir)
354 jw_object_string(&jw, "cd", cmd->dir);
355 jw_object_bool(&jw, "use_shell", cmd->use_shell);
356 jw_object_inline_begin_array(&jw, "argv");
357 if (cmd->git_cmd)
358 jw_array_string(&jw, "git");
d3b21597 359 jw_array_argv(&jw, cmd->args.v);
ee4512ed
JH
360 jw_end(&jw);
361 jw_end(&jw);
362
363 tr2_dst_write_line(&tr2dst_event, &jw.json);
364 jw_release(&jw);
365}
366
367static void fn_child_exit_fl(const char *file, int line,
368 uint64_t us_elapsed_absolute, int cid, int pid,
369 int code, uint64_t us_elapsed_child)
370{
371 const char *event_name = "child_exit";
372 struct json_writer jw = JSON_WRITER_INIT;
373 double t_rel = (double)us_elapsed_child / 1000000.0;
374
375 jw_object_begin(&jw, 0);
376 event_fmt_prepare(event_name, file, line, NULL, &jw);
377 jw_object_intmax(&jw, "child_id", cid);
378 jw_object_intmax(&jw, "pid", pid);
379 jw_object_intmax(&jw, "code", code);
380 jw_object_double(&jw, "t_rel", 6, t_rel);
381 jw_end(&jw);
382
383 tr2_dst_write_line(&tr2dst_event, &jw.json);
384
385 jw_release(&jw);
386}
387
64bc7524
JH
388static void fn_child_ready_fl(const char *file, int line,
389 uint64_t us_elapsed_absolute, int cid, int pid,
390 const char *ready, uint64_t us_elapsed_child)
391{
392 const char *event_name = "child_ready";
393 struct json_writer jw = JSON_WRITER_INIT;
394 double t_rel = (double)us_elapsed_child / 1000000.0;
395
396 jw_object_begin(&jw, 0);
397 event_fmt_prepare(event_name, file, line, NULL, &jw);
398 jw_object_intmax(&jw, "child_id", cid);
399 jw_object_intmax(&jw, "pid", pid);
400 jw_object_string(&jw, "ready", ready);
401 jw_object_double(&jw, "t_rel", 6, t_rel);
402 jw_end(&jw);
403
404 tr2_dst_write_line(&tr2dst_event, &jw.json);
405
406 jw_release(&jw);
407}
408
ee4512ed
JH
409static void fn_thread_start_fl(const char *file, int line,
410 uint64_t us_elapsed_absolute)
411{
412 const char *event_name = "thread_start";
413 struct json_writer jw = JSON_WRITER_INIT;
414
415 jw_object_begin(&jw, 0);
416 event_fmt_prepare(event_name, file, line, NULL, &jw);
417 jw_end(&jw);
418
419 tr2_dst_write_line(&tr2dst_event, &jw.json);
420 jw_release(&jw);
421}
422
423static void fn_thread_exit_fl(const char *file, int line,
424 uint64_t us_elapsed_absolute,
425 uint64_t us_elapsed_thread)
426{
427 const char *event_name = "thread_exit";
428 struct json_writer jw = JSON_WRITER_INIT;
429 double t_rel = (double)us_elapsed_thread / 1000000.0;
430
431 jw_object_begin(&jw, 0);
432 event_fmt_prepare(event_name, file, line, NULL, &jw);
433 jw_object_double(&jw, "t_rel", 6, t_rel);
434 jw_end(&jw);
435
436 tr2_dst_write_line(&tr2dst_event, &jw.json);
437 jw_release(&jw);
438}
439
440static void fn_exec_fl(const char *file, int line, uint64_t us_elapsed_absolute,
441 int exec_id, const char *exe, const char **argv)
442{
443 const char *event_name = "exec";
444 struct json_writer jw = JSON_WRITER_INIT;
445
446 jw_object_begin(&jw, 0);
447 event_fmt_prepare(event_name, file, line, NULL, &jw);
448 jw_object_intmax(&jw, "exec_id", exec_id);
449 if (exe)
450 jw_object_string(&jw, "exe", exe);
451 jw_object_inline_begin_array(&jw, "argv");
452 jw_array_argv(&jw, argv);
453 jw_end(&jw);
454 jw_end(&jw);
455
456 tr2_dst_write_line(&tr2dst_event, &jw.json);
457 jw_release(&jw);
458}
459
460static void fn_exec_result_fl(const char *file, int line,
461 uint64_t us_elapsed_absolute, int exec_id,
462 int code)
463{
464 const char *event_name = "exec_result";
465 struct json_writer jw = JSON_WRITER_INIT;
466
467 jw_object_begin(&jw, 0);
468 event_fmt_prepare(event_name, file, line, NULL, &jw);
469 jw_object_intmax(&jw, "exec_id", exec_id);
470 jw_object_intmax(&jw, "code", code);
471 jw_end(&jw);
472
473 tr2_dst_write_line(&tr2dst_event, &jw.json);
474 jw_release(&jw);
475}
476
477static void fn_param_fl(const char *file, int line, const char *param,
478 const char *value)
479{
480 const char *event_name = "def_param";
481 struct json_writer jw = JSON_WRITER_INIT;
35ae40ea
TL
482 enum config_scope scope = current_config_scope();
483 const char *scope_name = config_scope_name(scope);
ee4512ed
JH
484
485 jw_object_begin(&jw, 0);
486 event_fmt_prepare(event_name, file, line, NULL, &jw);
35ae40ea 487 jw_object_string(&jw, "scope", scope_name);
ee4512ed
JH
488 jw_object_string(&jw, "param", param);
489 jw_object_string(&jw, "value", value);
490 jw_end(&jw);
491
492 tr2_dst_write_line(&tr2dst_event, &jw.json);
493 jw_release(&jw);
494}
495
496static void fn_repo_fl(const char *file, int line,
497 const struct repository *repo)
498{
499 const char *event_name = "def_repo";
500 struct json_writer jw = JSON_WRITER_INIT;
501
502 jw_object_begin(&jw, 0);
503 event_fmt_prepare(event_name, file, line, repo, &jw);
504 jw_object_string(&jw, "worktree", repo->worktree);
505 jw_end(&jw);
506
507 tr2_dst_write_line(&tr2dst_event, &jw.json);
508 jw_release(&jw);
509}
510
511static void fn_region_enter_printf_va_fl(const char *file, int line,
512 uint64_t us_elapsed_absolute,
513 const char *category,
514 const char *label,
515 const struct repository *repo,
516 const char *fmt, va_list ap)
517{
518 const char *event_name = "region_enter";
519 struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
bce9db6d 520 if (ctx->nr_open_regions <= tr2env_event_max_nesting_levels) {
ee4512ed
JH
521 struct json_writer jw = JSON_WRITER_INIT;
522
523 jw_object_begin(&jw, 0);
524 event_fmt_prepare(event_name, file, line, repo, &jw);
525 jw_object_intmax(&jw, "nesting", ctx->nr_open_regions);
526 if (category)
527 jw_object_string(&jw, "category", category);
528 if (label)
529 jw_object_string(&jw, "label", label);
530 maybe_add_string_va(&jw, "msg", fmt, ap);
531 jw_end(&jw);
532
533 tr2_dst_write_line(&tr2dst_event, &jw.json);
534 jw_release(&jw);
535 }
536}
537
538static void fn_region_leave_printf_va_fl(
539 const char *file, int line, uint64_t us_elapsed_absolute,
540 uint64_t us_elapsed_region, const char *category, const char *label,
541 const struct repository *repo, const char *fmt, va_list ap)
542{
543 const char *event_name = "region_leave";
544 struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
bce9db6d 545 if (ctx->nr_open_regions <= tr2env_event_max_nesting_levels) {
ee4512ed
JH
546 struct json_writer jw = JSON_WRITER_INIT;
547 double t_rel = (double)us_elapsed_region / 1000000.0;
548
549 jw_object_begin(&jw, 0);
550 event_fmt_prepare(event_name, file, line, repo, &jw);
551 jw_object_double(&jw, "t_rel", 6, t_rel);
552 jw_object_intmax(&jw, "nesting", ctx->nr_open_regions);
553 if (category)
554 jw_object_string(&jw, "category", category);
555 if (label)
556 jw_object_string(&jw, "label", label);
557 maybe_add_string_va(&jw, "msg", fmt, ap);
558 jw_end(&jw);
559
560 tr2_dst_write_line(&tr2dst_event, &jw.json);
561 jw_release(&jw);
562 }
563}
564
565static void fn_data_fl(const char *file, int line, uint64_t us_elapsed_absolute,
566 uint64_t us_elapsed_region, const char *category,
567 const struct repository *repo, const char *key,
568 const char *value)
569{
570 const char *event_name = "data";
571 struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
bce9db6d 572 if (ctx->nr_open_regions <= tr2env_event_max_nesting_levels) {
ee4512ed
JH
573 struct json_writer jw = JSON_WRITER_INIT;
574 double t_abs = (double)us_elapsed_absolute / 1000000.0;
575 double t_rel = (double)us_elapsed_region / 1000000.0;
576
577 jw_object_begin(&jw, 0);
578 event_fmt_prepare(event_name, file, line, repo, &jw);
579 jw_object_double(&jw, "t_abs", 6, t_abs);
580 jw_object_double(&jw, "t_rel", 6, t_rel);
581 jw_object_intmax(&jw, "nesting", ctx->nr_open_regions);
582 jw_object_string(&jw, "category", category);
583 jw_object_string(&jw, "key", key);
584 jw_object_string(&jw, "value", value);
585 jw_end(&jw);
586
587 tr2_dst_write_line(&tr2dst_event, &jw.json);
588 jw_release(&jw);
589 }
590}
591
592static void fn_data_json_fl(const char *file, int line,
593 uint64_t us_elapsed_absolute,
594 uint64_t us_elapsed_region, const char *category,
595 const struct repository *repo, const char *key,
596 const struct json_writer *value)
597{
598 const char *event_name = "data_json";
599 struct tr2tls_thread_ctx *ctx = tr2tls_get_self();
bce9db6d 600 if (ctx->nr_open_regions <= tr2env_event_max_nesting_levels) {
ee4512ed
JH
601 struct json_writer jw = JSON_WRITER_INIT;
602 double t_abs = (double)us_elapsed_absolute / 1000000.0;
603 double t_rel = (double)us_elapsed_region / 1000000.0;
604
605 jw_object_begin(&jw, 0);
606 event_fmt_prepare(event_name, file, line, repo, &jw);
607 jw_object_double(&jw, "t_abs", 6, t_abs);
608 jw_object_double(&jw, "t_rel", 6, t_rel);
609 jw_object_intmax(&jw, "nesting", ctx->nr_open_regions);
610 jw_object_string(&jw, "category", category);
611 jw_object_string(&jw, "key", key);
612 jw_object_sub_jw(&jw, "value", value);
613 jw_end(&jw);
614
615 tr2_dst_write_line(&tr2dst_event, &jw.json);
616 jw_release(&jw);
617 }
618}
619
620struct tr2_tgt tr2_tgt_event = {
98593057
ÆAB
621 .pdst = &tr2dst_event,
622
623 .pfn_init = fn_init,
624 .pfn_term = fn_term,
625
626 .pfn_version_fl = fn_version_fl,
627 .pfn_start_fl = fn_start_fl,
628 .pfn_exit_fl = fn_exit_fl,
629 .pfn_signal = fn_signal,
630 .pfn_atexit = fn_atexit,
631 .pfn_error_va_fl = fn_error_va_fl,
632 .pfn_command_path_fl = fn_command_path_fl,
633 .pfn_command_ancestry_fl = fn_command_ancestry_fl,
634 .pfn_command_name_fl = fn_command_name_fl,
635 .pfn_command_mode_fl = fn_command_mode_fl,
636 .pfn_alias_fl = fn_alias_fl,
637 .pfn_child_start_fl = fn_child_start_fl,
638 .pfn_child_exit_fl = fn_child_exit_fl,
639 .pfn_child_ready_fl = fn_child_ready_fl,
640 .pfn_thread_start_fl = fn_thread_start_fl,
641 .pfn_thread_exit_fl = fn_thread_exit_fl,
642 .pfn_exec_fl = fn_exec_fl,
643 .pfn_exec_result_fl = fn_exec_result_fl,
644 .pfn_param_fl = fn_param_fl,
645 .pfn_repo_fl = fn_repo_fl,
646 .pfn_region_enter_printf_va_fl = fn_region_enter_printf_va_fl,
647 .pfn_region_leave_printf_va_fl = fn_region_leave_printf_va_fl,
648 .pfn_data_fl = fn_data_fl,
649 .pfn_data_json_fl = fn_data_json_fl,
650 .pfn_printf_va_fl = NULL,
ee4512ed 651};