libbpf: Avoid designated initializers for unnamed union members
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 19 Jul 2019 14:34:07 +0000 (11:34 -0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 22 Jul 2019 14:14:43 +0000 (16:14 +0200)
commit4be6e05c4d4c2ff87750d3242f69999245d119f8
treea6ccb5b89caa2e4f8570319add9749a5ee63ae7b
parentcdb2f9207109c9c858277fde8b7dc1445b9f952e
libbpf: Avoid designated initializers for unnamed union members

As it fails to build in some systems with:

  libbpf.c: In function 'perf_buffer__new':
  libbpf.c:4515: error: unknown field 'sample_period' specified in initializer
  libbpf.c:4516: error: unknown field 'wakeup_events' specified in initializer

Doing as:

    attr.sample_period = 1;

I.e. not as a designated initializer makes it build everywhere.

Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: fb84b8224655 ("libbpf: add perf buffer API")
Link: https://lkml.kernel.org/n/tip-hnlmch8qit1ieksfppmr32si@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c