WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #39: new file mode 100644 WARNING: externs should be avoided in .c files #227: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:22: +extern struct task_struct *bpf_task_from_vpid(pid_t vpid) __ksym; WARNING: line length of 90 exceeds 80 columns #233: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:28: +extern struct vm_area_struct *bpf_iter_task_vma_next(struct bpf_iter_task_vma *it) __ksym; WARNING: externs should be avoided in .c files #233: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:28: +extern struct vm_area_struct *bpf_iter_task_vma_next(struct bpf_iter_task_vma *it) __ksym; WARNING: Missing a blank line after declarations #242: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:37: + struct task_struct *task = bpf_task_from_vpid(arg->pid); + if (!task) { WARNING: line length of 96 exceeds 80 columns #252: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:47: + struct event_vma *e_vma = bpf_ringbuf_reserve(&rb, sizeof(struct event_vma), 0); WARNING: Missing a blank line after declarations #253: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:48: + struct event_vma *e_vma = bpf_ringbuf_reserve(&rb, sizeof(struct event_vma), 0); + if (!e_vma) { WARNING: Missing a blank line after declarations #282: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:77: + struct task_struct *task = bpf_task_from_vpid(arg->pid); + if (!task) { WARNING: line length of 91 exceeds 80 columns #287: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:82: + struct event_task *e_task = bpf_ringbuf_reserve(&rb, sizeof(struct event_task), 0); WARNING: Missing a blank line after declarations #288: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:83: + struct event_task *e_task = bpf_ringbuf_reserve(&rb, sizeof(struct event_task), 0); + if (!e_task) { WARNING: line length of 85 exceeds 80 columns #303: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:98: + struct event_mm *e_mm = bpf_ringbuf_reserve(&rb, sizeof(struct event_mm), 0); WARNING: Missing a blank line after declarations #304: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:99: + struct event_mm *e_mm = bpf_ringbuf_reserve(&rb, sizeof(struct event_mm), 0); + if (!e_mm) { WARNING: Missing a blank line after declarations #310: FILE: tools/testing/selftests/crib/test_dump_task.bpf.c:105: + struct mm_struct *mm = BPF_CORE_READ(task, mm); + e_mm->hdr.type = EVENT_TYPE_MM; WARNING: Missing a blank line after declarations #400: FILE: tools/testing/selftests/crib/test_dump_task.c:64: + struct vma *vma = &info->vma[info->vma_count]; + vma->vm_start = e_vma->vm_start; WARNING: Missing a blank line after declarations #465: FILE: tools/testing/selftests/crib/test_dump_task.c:129: + FILE *file = fopen("/proc/self/stat", "r"); + if (!file) WARNING: quoted string split across lines #469: FILE: tools/testing/selftests/crib/test_dump_task.c:133: + fscanf(file, "%d %s %*c %*d %*d %*d %*d %*d %u %*lu %*lu %*lu %*lu " + "%*lu %*lu %*ld %*ld %d %*ld %*d %*d %*llu %*lu %*ld %*lu %lu %lu %lu " WARNING: quoted string split across lines #470: FILE: tools/testing/selftests/crib/test_dump_task.c:134: + "%*lu %*lu %*ld %*ld %d %*ld %*d %*d %*llu %*lu %*ld %*lu %lu %lu %lu " + "%*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*d %*d %*u %u %*llu %*lu %*ld " WARNING: quoted string split across lines #471: FILE: tools/testing/selftests/crib/test_dump_task.c:135: + "%*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*lu %*d %*d %*u %u %*llu %*lu %*ld " + "%lu %lu %lu %lu %lu %lu %lu %d", WARNING: line length of 89 exceeds 80 columns #472: FILE: tools/testing/selftests/crib/test_dump_task.c:136: + &info->task.pid, info->task.comm, &info->task.flags, &info->task.prio, WARNING: line length of 83 exceeds 80 columns #473: FILE: tools/testing/selftests/crib/test_dump_task.c:137: + &info->mm.start_code, &info->mm.end_code, &info->mm.start_stack, WARNING: line length of 82 exceeds 80 columns #476: FILE: tools/testing/selftests/crib/test_dump_task.c:140: + &info->mm.env_start, &info->mm.env_end, &info->task.exit_code); WARNING: Missing a blank line after declarations #486: FILE: tools/testing/selftests/crib/test_dump_task.c:150: + char *token = strtok(buf, " "); + do { ERROR: while should follow close brace '}' #550: FILE: tools/testing/selftests/crib/test_dump_task.c:214: + } + while ((token = strtok(NULL, " ")) != NULL); WARNING: Missing a blank line after declarations #556: FILE: tools/testing/selftests/crib/test_dump_task.c:220: + FILE *file = fopen("/proc/self/smaps", "r"); + if (!file) WARNING: Missing a blank line after declarations #562: FILE: tools/testing/selftests/crib/test_dump_task.c:226: + ssize_t nread; + while ((nread = getline(&line, &len, file)) != -1) { WARNING: Missing a blank line after declarations #564: FILE: tools/testing/selftests/crib/test_dump_task.c:228: + struct vma *vma = &info->vma[info->vma_count]; + if (isupper(*line)) { WARNING: unchecked sscanf return value #570: FILE: tools/testing/selftests/crib/test_dump_task.c:234: + sscanf(line, "%lx-%lx %*c%*c%*c%*c %lx", + &vma->vm_start, &vma->vm_end, &vma->vm_pgoff); CHECK: Alignment should match open parenthesis #571: FILE: tools/testing/selftests/crib/test_dump_task.c:235: + sscanf(line, "%lx-%lx %*c%*c%*c%*c %lx", + &vma->vm_start, &vma->vm_end, &vma->vm_pgoff); WARNING: line length of 96 exceeds 80 columns #579: FILE: tools/testing/selftests/crib/test_dump_task.c:243: +static int check_dump_info_correctness(struct dump_info *crib_info, struct dump_info *proc_info) CHECK: Alignment should match open parenthesis #582: FILE: tools/testing/selftests/crib/test_dump_task.c:246: + if (crib_info->task.pid != proc_info->task.pid || + crib_info->task.flags != proc_info->task.flags || CHECK: Alignment should match open parenthesis #591: FILE: tools/testing/selftests/crib/test_dump_task.c:255: + if (crib_info->mm.start_code != proc_info->mm.start_code || + crib_info->mm.end_code != proc_info->mm.end_code || WARNING: Missing a blank line after declarations #603: FILE: tools/testing/selftests/crib/test_dump_task.c:267: + struct vma *crib_vma, *proc_vma; + for (int i = 0; i < crib_info->mm.map_count; i++) { CHECK: Alignment should match open parenthesis #607: FILE: tools/testing/selftests/crib/test_dump_task.c:271: + if (crib_vma->vm_start != proc_vma->vm_start || + crib_vma->vm_end != proc_vma->vm_end || WARNING: line length of 86 exceeds 80 columns #609: FILE: tools/testing/selftests/crib/test_dump_task.c:273: + crib_vma->vm_pgoff << CONFIG_PAGE_SHIFT != proc_vma->vm_pgoff) CHECK: Alignment should match open parenthesis #623: FILE: tools/testing/selftests/crib/test_dump_task.c:287: + DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts, + .ctx_in = &args, WARNING: Missing a blank line after declarations #628: FILE: tools/testing/selftests/crib/test_dump_task.c:292: + struct test_dump_task_bpf *skel = test_dump_task_bpf__open_and_load(); + ASSERT_NE(skel, NULL); WARNING: Missing a blank line after declarations #631: FILE: tools/testing/selftests/crib/test_dump_task.c:295: + int dump_task_stat_fd = bpf_program__fd(skel->progs.dump_task_stat); + ASSERT_GT(dump_task_stat_fd, 0); WARNING: Missing a blank line after declarations #634: FILE: tools/testing/selftests/crib/test_dump_task.c:298: + int dump_all_vma_fd = bpf_program__fd(skel->progs.dump_all_vma); + ASSERT_GT(dump_all_vma_fd, 0); WARNING: Missing a blank line after declarations #637: FILE: tools/testing/selftests/crib/test_dump_task.c:301: + struct dump_info crib_info, proc_info; + memset(&crib_info, 0, sizeof(struct dump_info)); WARNING: line length of 91 exceeds 80 columns #640: FILE: tools/testing/selftests/crib/test_dump_task.c:304: + struct ring_buffer *rb = ring_buffer__new(bpf_map__fd(skel->maps.rb), handle_event, WARNING: line length of 96 exceeds 80 columns #653: FILE: tools/testing/selftests/crib/test_dump_task.c:317: + printf("CRIB dump took %f seconds\n", (double)(crib_end - crib_begin) / CLOCKS_PER_SEC); WARNING: line length of 96 exceeds 80 columns #657: FILE: tools/testing/selftests/crib/test_dump_task.c:321: + proc_info.vma = (struct vma *)malloc(sizeof(struct vma) * (crib_info.mm.map_count + 1)); WARNING: line length of 96 exceeds 80 columns #663: FILE: tools/testing/selftests/crib/test_dump_task.c:327: + printf("PROC dump took %f seconds\n", (double)(proc_end - proc_begin) / CLOCKS_PER_SEC); WARNING: Improper SPDX comment style for 'tools/testing/selftests/crib/test_dump_task.h', please use '/*' instead #680: FILE: tools/testing/selftests/crib/test_dump_task.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #680: FILE: tools/testing/selftests/crib/test_dump_task.h:1: +// SPDX-License-Identifier: GPL-2.0 total: 1 errors, 39 warnings, 5 checks, 696 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit 5d8ce84ccf94 ("selftests/crib: Add test for getting basic information of the process") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.