linux-stable/tools
Manu Bretelle 6bd5e167af bpftool: Wrap struct_ops dump in an array
When dumping a struct_ops, 2 dictionaries are emitted.

When using `name`, they were already wrapped in an array, but not when
using `id`. Causing `jq` to fail at parsing the payload as it reached
the comma following the first dict.

This change wraps those dictionaries in an array so valid json is emitted.

Before, jq fails to parse the output:
```
 $ sudo bpftool struct_ops dump id 1523612 | jq . > /dev/null
parse error: Expected value before ',' at line 19, column 2
```

After, no error parsing the output:
```
sudo ./bpftool  struct_ops dump id 1523612 | jq . > /dev/null
```

Signed-off-by: Manu Bretelle <chantr4@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20231018230133.1593152-3-chantr4@gmail.com
2023-10-19 16:30:15 +02:00
..
accounting
arch tools arch x86: Sync the msr-index.h copy with the kernel sources 2023-09-13 08:53:37 -03:00
bootconfig
bpf bpftool: Wrap struct_ops dump in an array 2023-10-19 16:30:15 +02:00
build perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
certs
cgroup iocost_monitor: improve it by adding iocg wait_ms 2023-08-08 15:43:03 -06:00
counter
crypto/ccp
debugging
edid
firewire
firmware
gpio
hv hv/hv_kvp_daemon:Support for keyfile based connection profile 2023-10-10 03:42:29 +00:00
iio
include bpf-next-for-netdev 2023-10-16 21:05:33 -07:00
kvm/kvm_stat
laptop
leds
lib libbpf: Don't assume SHT_GNU_verdef presence for SHT_GNU_versym section 2023-10-17 11:43:20 +02:00
memory-model
mm tools/mm: fix undefined reference to pthread_once 2023-09-05 10:13:45 -07:00
net/ynl tools: ynl: use ynl-gen -o instead of stdout in Makefile 2023-10-11 13:33:06 -07:00
objtool objtool: Fix _THIS_IP_ detection for cold functions 2023-09-12 08:16:54 +02:00
pci
pcmcia
perf perf jevent: fix core dump on software events on s390 2023-09-17 15:51:57 -07:00
power More power management updates for 6.6-rc1 2023-09-04 15:21:55 -07:00
rcu
scripts
spi
testing selftests/bpf: Add options and frags to xdp_hw_metadata 2023-10-18 10:08:28 +02:00
thermal
time
tracing rtla/timerlat: Do not stop user-space if a cpu is offline 2023-09-22 14:43:46 +02:00
usb
verification
virtio
wmi
workqueue workqueue: Implement non-strict affinity scope for unbound workqueues 2023-08-07 15:57:25 -10:00
Makefile