tree:
https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git perf/build_id
head: de806ae0b079ea38a0a6377ae3769631d7dc0aec
commit: b54894acd9bdff82ee77f71fcf42eb891cb86a33 [12/24] perf tools: Store build id from
mmap2 events
config: i386-randconfig-m021-20201118 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
kernel/events/core.c:8021 perf_event_mmap_output() warn: inconsistent indenting
vim +8021 kernel/events/core.c
7973
7974 static void perf_event_mmap_output(struct perf_event *event,
7975 void *data)
7976 {
7977 struct perf_mmap_event *mmap_event = data;
7978 struct perf_output_handle handle;
7979 struct perf_sample_data sample;
7980 int size = mmap_event->event_id.header.size;
7981 u32 type = mmap_event->event_id.header.type;
7982 bool use_build_id;
7983 int ret;
7984
7985 if (!perf_event_mmap_match(event, data))
7986 return;
7987
7988 if (event->attr.mmap2) {
7989 mmap_event->event_id.header.type = PERF_RECORD_MMAP2;
7990 mmap_event->event_id.header.size += sizeof(mmap_event->maj);
7991 mmap_event->event_id.header.size += sizeof(mmap_event->min);
7992 mmap_event->event_id.header.size += sizeof(mmap_event->ino);
7993 mmap_event->event_id.header.size += sizeof(mmap_event->ino_generation);
7994 mmap_event->event_id.header.size += sizeof(mmap_event->prot);
7995 mmap_event->event_id.header.size += sizeof(mmap_event->flags);
7996 }
7997
7998 perf_event_header__init_id(&mmap_event->event_id.header, &sample,
event);
7999 ret = perf_output_begin(&handle, event,
8000 mmap_event->event_id.header.size);
8001 if (ret)
8002 goto out;
8003
8004 mmap_event->event_id.pid = perf_event_pid(event, current);
8005 mmap_event->event_id.tid = perf_event_tid(event, current);
8006
8007 use_build_id = event->attr.build_id && mmap_event->build_id_size;
8008
8009 if (event->attr.mmap2 && use_build_id)
8010 mmap_event->event_id.header.misc |= PERF_RECORD_MISC_MMAP_BUILD_ID;
8011
8012 perf_output_put(&handle, mmap_event->event_id);
8013
8014 if (event->attr.mmap2) {
8015 if (use_build_id) {
8016 u8 size[4] = { (u8) mmap_event->build_id_size, 0, 0, 0 };
8017
8018 __output_copy(&handle, size, 4);
8019 __output_copy(&handle, mmap_event->build_id, BUILD_ID_SIZE);
8020
8021 if (mmap_event->build_id_size > 20)
8022 trace_printk("build_id_size %u %s\n", mmap_event->build_id_size,
mmap_event->file_name);
8023
8024 } else {
8025 perf_output_put(&handle, mmap_event->maj);
8026 perf_output_put(&handle, mmap_event->min);
8027 perf_output_put(&handle, mmap_event->ino);
8028 perf_output_put(&handle, mmap_event->ino_generation);
8029 }
8030 perf_output_put(&handle, mmap_event->prot);
8031 perf_output_put(&handle, mmap_event->flags);
8032 }
8033
8034 __output_copy(&handle, mmap_event->file_name,
8035 mmap_event->file_size);
8036
8037 perf_event__output_id_sample(event, &handle, &sample);
8038
8039 perf_output_end(&handle);
8040 out:
8041 mmap_event->event_id.header.size = size;
8042 mmap_event->event_id.header.type = type;
8043 }
8044
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org