Lines Matching defs:wtr
180 struct json_writer *wtr);
184 * Then call "func(fd, info, data, wtr)" on each struct_ops map found.
187 struct json_writer *wtr)
200 if (wtr)
201 jsonw_start_array(wtr);
204 err = func(fd, info, data, wtr);
209 if (wtr)
210 jsonw_end_array(wtr);
215 if (!wtr && name && !res.nr_errs && !res.nr_maps)
221 else if (!wtr && json_output && !res.nr_errs)
222 /* The "func()" above is not writing any json (i.e. !wtr
236 struct json_writer *wtr)
279 if (func(fd, info, data, wtr))
281 else if (!wtr && json_output)
282 /* The "func()" above is not writing any json (i.e. !wtr
301 struct json_writer *wtr)
305 return do_one_id(search_term, func, data, wtr);
310 return do_search(search_term, func, data, wtr);
314 struct json_writer *wtr)
316 if (wtr) {
317 jsonw_start_object(wtr);
318 jsonw_uint_field(wtr, "id", info->id);
319 jsonw_string_field(wtr, "name", info->name);
320 jsonw_string_field(wtr, "kernel_struct_ops",
322 jsonw_end_object(wtr);
351 struct json_writer *wtr)
360 /* note: d->jw == wtr */
384 jsonw_start_object(wtr);
385 jsonw_name(wtr, "bpf_map_info");
387 jsonw_end_object(wtr);
389 jsonw_start_object(wtr);
390 jsonw_name(wtr, struct_ops_name);
392 jsonw_end_object(wtr);
402 json_writer_t *wtr = json_wtr;
420 wtr = jsonw_new(stdout);
421 if (!wtr) {
425 jsonw_pretty(wtr, true);
429 d.jw = wtr;
434 wtr);
437 jsonw_destroy(&wtr);
443 struct json_writer *wtr)