--------------------------------------------------------------- 0001-record-Modify-two-function-declaration-that-used-by-.patch --------------------------------------------------------------- total: 0 errors, 0 warnings, 18 lines checked 0001-record-Modify-two-function-declaration-that-used-by-.patch has no obvious style problems and is ready for submission. --------------------------------------------------------------- 0002-mcount-Modify-mcount-to-enable-hook-the-mcount_start.patch --------------------------------------------------------------- ERROR: Bad function definition - __weak void pre_startup() should probably be __weak void pre_startup(void) #27: FILE: libmcount/mcount.c:1421: +__weak void pre_startup() ERROR: Bad function definition - __weak void post_startup() should probably be __weak void post_startup(void) #32: FILE: libmcount/mcount.c:1426: +__weak void post_startup() total: 2 errors, 0 warnings, 26 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. 0002-mcount-Modify-mcount-to-enable-hook-the-mcount_start.patch has style problems, please review. -------------------------------------------------- 0003-utils-Add-utility-for-inject-and-ptrace.patch -------------------------------------------------- WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #30: new file mode 100644 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #35: FILE: utils/inject-utils.c:1: +#include WARNING: Missing a blank line after declarations #68: FILE: utils/inject-utils.c:34: + char perms[5]; + sprintf(filename, "/proc/%d/maps", pid); ERROR: space required before the open parenthesis '(' #70: FILE: utils/inject-utils.c:36: + if(fp == NULL) WARNING: unnecessary whitespace before a quoted newline #71: FILE: utils/inject-utils.c:37: + pr_err("cannot open /proc/%d/maps \n", pid); ERROR: space required before the open parenthesis '(' #72: FILE: utils/inject-utils.c:38: + while(fgets(line, 850, fp) != NULL) { WARNING: unchecked sscanf return value #73: FILE: utils/inject-utils.c:39: + sscanf(line, "%lx-%*x %s %*s %s %*d", &addr, perms, str); ERROR: space required before the open parenthesis '(' #74: FILE: utils/inject-utils.c:40: + if(strstr(perms, "x") != NULL) { WARNING: braces {} are not necessary for single statement blocks #74: FILE: utils/inject-utils.c:40: + if(strstr(perms, "x") != NULL) { + break; + } WARNING: Missing a blank line after declarations #102: FILE: utils/inject-utils.c:68: + long addr; + sprintf(filename, "/proc/%d/maps", pid); ERROR: space required before the open parenthesis '(' #104: FILE: utils/inject-utils.c:70: + if(fp == NULL) WARNING: unnecessary whitespace before a quoted newline #105: FILE: utils/inject-utils.c:71: + pr_err("cannot open /proc/%d/maps \n", pid); ERROR: space required before the open parenthesis '(' #106: FILE: utils/inject-utils.c:72: + while(fgets(line, 850, fp) != NULL) { WARNING: unchecked sscanf return value #107: FILE: utils/inject-utils.c:73: + sscanf(line, "%lx-%*x %*s %*s %*s %*d", &addr); ERROR: space required before the open parenthesis '(' #108: FILE: utils/inject-utils.c:74: + if(strstr(line, "libc-") != NULL) { WARNING: braces {} are not necessary for single statement blocks #108: FILE: utils/inject-utils.c:74: + if(strstr(line, "libc-") != NULL) { + break; + } ERROR: "foo* bar" should be "foo *bar" #133: FILE: utils/inject-utils.c:99: +int checkloaded(pid_t pid, char* libname) WARNING: Missing a blank line after declarations #139: FILE: utils/inject-utils.c:105: + long addr; + sprintf(filename, "/proc/%d/maps", pid); ERROR: space required before the open parenthesis '(' #141: FILE: utils/inject-utils.c:107: + if(fp == NULL) WARNING: unnecessary whitespace before a quoted newline #142: FILE: utils/inject-utils.c:108: + pr_err("cannot open /proc/%d/maps \n", pid); ERROR: space required before the open parenthesis '(' #143: FILE: utils/inject-utils.c:109: + while(fgets(line, 850, fp) != NULL) { WARNING: unchecked sscanf return value #144: FILE: utils/inject-utils.c:110: + sscanf(line, "%lx-%*x %*s %*s %*s %*d", &addr); ERROR: space required before the open parenthesis '(' #145: FILE: utils/inject-utils.c:111: + if(strstr(line, libname) != NULL) { ERROR: "foo* bar" should be "foo *bar" #167: FILE: utils/inject-utils.c:133: +long get_function_addr(char* func_name) ERROR: "foo* bar" should be "foo *bar" #169: FILE: utils/inject-utils.c:135: + void* self = dlopen("libc.so.6", RTLD_LAZY); ERROR: "foo* bar" should be "foo *bar" #170: FILE: utils/inject-utils.c:136: + void* func_addr = dlsym(self, func_name); WARNING: Missing a blank line after declarations #171: FILE: utils/inject-utils.c:137: + void* func_addr = dlsym(self, func_name); + return (long)func_addr; ERROR: "foo* bar" should be "foo *bar" #199: FILE: utils/inject-utils.c:165: +unsigned char* find_ret(void* end_addr) ERROR: "foo* bar" should be "foo *bar" #199: FILE: utils/inject-utils.c:165: +unsigned char* find_ret(void* end_addr) ERROR: "foo* bar" should be "foo *bar" #201: FILE: utils/inject-utils.c:167: + unsigned char* ret_inst_addr = end_addr; WARNING: Missing a blank line after declarations #202: FILE: utils/inject-utils.c:168: + unsigned char* ret_inst_addr = end_addr; + while(*ret_inst_addr != INTEL_RET_INSTRUCTION) { ERROR: space required before the open parenthesis '(' #202: FILE: utils/inject-utils.c:168: + while(*ret_inst_addr != INTEL_RET_INSTRUCTION) { WARNING: braces {} are not necessary for single statement blocks #202: FILE: utils/inject-utils.c:168: + while(*ret_inst_addr != INTEL_RET_INSTRUCTION) { + ret_inst_addr--; + } WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #213: FILE: utils/inject-utils.h:1: +#define INTEL_RET_INSTRUCTION 0xc3 ERROR: "foo* bar" should be "foo *bar" #218: FILE: utils/inject-utils.h:6: +int checkloaded(pid_t pid, char* libname); ERROR: "foo* bar" should be "foo *bar" #219: FILE: utils/inject-utils.h:7: +long get_function_addr(char* funcName); ERROR: "foo* bar" should be "foo *bar" #220: FILE: utils/inject-utils.h:8: +unsigned char* find_ret(void* end_addr); ERROR: "foo* bar" should be "foo *bar" #220: FILE: utils/inject-utils.h:8: +unsigned char* find_ret(void* end_addr); WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #227: FILE: utils/ptrace.c:1: +#include ERROR: space required before the open parenthesis '(' #252: FILE: utils/ptrace.c:26: + if(ptrace(PTRACE_ATTACH, target, NULL, NULL) == -1) { WARNING: braces {} are not necessary for single statement blocks #252: FILE: utils/ptrace.c:26: + if(ptrace(PTRACE_ATTACH, target, NULL, NULL) == -1) { + pr_err("ptrace(PTRACE_ATTACH) failed\n"); + } ERROR: space required before the open parenthesis '(' #256: FILE: utils/ptrace.c:30: + if(waitpid(target, &waitpidstatus, WUNTRACED) != target) { WARNING: braces {} are not necessary for single statement blocks #256: FILE: utils/ptrace.c:30: + if(waitpid(target, &waitpidstatus, WUNTRACED) != target) { + pr_err("waitpid(%d) failed\n", target); + } ERROR: space required before the open parenthesis '(' #274: FILE: utils/ptrace.c:48: + if(ptrace(PTRACE_DETACH, target, NULL, NULL) == -1) { WARNING: braces {} are not necessary for single statement blocks #274: FILE: utils/ptrace.c:48: + if(ptrace(PTRACE_DETACH, target, NULL, NULL) == -1) { + pr_err("ptrace(PTRACE_DETACH) failed\n"); + } ERROR: "foo* bar" should be "foo *bar" #292: FILE: utils/ptrace.c:66: +void ptrace_getregs(pid_t target, struct REG_TYPE* regs) WARNING: struct should normally be const #292: FILE: utils/ptrace.c:66: +void ptrace_getregs(pid_t target, struct REG_TYPE* regs) ERROR: space required before the open parenthesis '(' #294: FILE: utils/ptrace.c:68: + if(ptrace(PTRACE_GETREGS, target, NULL, regs) == -1) { WARNING: braces {} are not necessary for single statement blocks #294: FILE: utils/ptrace.c:68: + if(ptrace(PTRACE_GETREGS, target, NULL, regs) == -1) { + pr_err("ptrace(PTRACE_GETREGS) failed\n"); + } ERROR: "foo* bar" should be "foo *bar" #312: FILE: utils/ptrace.c:86: + struct timespec* sleeptime = malloc(sizeof(struct timespec)); WARNING: struct should normally be const #312: FILE: utils/ptrace.c:86: + struct timespec* sleeptime = malloc(sizeof(struct timespec)); ERROR: space required before the open parenthesis '(' #317: FILE: utils/ptrace.c:91: + if(ptrace(PTRACE_CONT, target, NULL, NULL) == -1) { WARNING: braces {} are not necessary for single statement blocks #317: FILE: utils/ptrace.c:91: + if(ptrace(PTRACE_CONT, target, NULL, NULL) == -1) { + pr_err("ptrace(PTRACE_CONT) failed\n"); + } ERROR: "foo* bar" should be "foo *bar" #339: FILE: utils/ptrace.c:113: +void ptrace_setregs(pid_t target, struct REG_TYPE* regs) WARNING: struct should normally be const #339: FILE: utils/ptrace.c:113: +void ptrace_setregs(pid_t target, struct REG_TYPE* regs) ERROR: space required before the open parenthesis '(' #341: FILE: utils/ptrace.c:115: + if(ptrace(PTRACE_SETREGS, target, NULL, regs) == -1) { WARNING: braces {} are not necessary for single statement blocks #341: FILE: utils/ptrace.c:115: + if(ptrace(PTRACE_SETREGS, target, NULL, regs) == -1) { + pr_err("ptrace(PTRACE_SETREGS) failed\n"); + } WARNING: Missing a blank line after declarations #364: FILE: utils/ptrace.c:138: + siginfo_t targetsig; + if(ptrace(PTRACE_GETSIGINFO, target, NULL, &targetsig) == -1) ERROR: that open brace { should be on the previous line #364: FILE: utils/ptrace.c:138: + if(ptrace(PTRACE_GETSIGINFO, target, NULL, &targetsig) == -1) + { ERROR: space required before the open parenthesis '(' #364: FILE: utils/ptrace.c:138: + if(ptrace(PTRACE_GETSIGINFO, target, NULL, &targetsig) == -1) ERROR: space required before the open parenthesis '(' #392: FILE: utils/ptrace.c:166: + if(word == -1) { ERROR: space required before the open parenthesis '(' #422: FILE: utils/ptrace.c:196: + if(word == -1) { WARNING: braces {} are not necessary for single statement blocks #422: FILE: utils/ptrace.c:196: + if(word == -1) { + pr_err("ptrace(PTRACE_POKETEXT) failed\n"); + } ERROR: space required before the open parenthesis '(' #448: FILE: utils/ptrace.c:222: + if(targetsig.si_signo != SIGTRAP) { WARNING: line over 80 characters #449: FILE: utils/ptrace.c:223: + pr_dbg("instead of expected SIGTRAP, target stopped with signal %d: %s\n", targetsig.si_signo, strsignal(targetsig.si_signo)); WARNING: line over 80 characters #450: FILE: utils/ptrace.c:224: + pr_dbg("sending process %d a SIGSTOP signal for debugging purposes\n", pid); WARNING: line over 80 characters #471: FILE: utils/ptrace.c:245: +void restore_state_and_detach(pid_t target, unsigned long addr, void* backup, int datasize, struct REG_TYPE oldregs) ERROR: "foo* bar" should be "foo *bar" #471: FILE: utils/ptrace.c:245: +void restore_state_and_detach(pid_t target, unsigned long addr, void* backup, int datasize, struct REG_TYPE oldregs) WARNING: struct should normally be const #471: FILE: utils/ptrace.c:245: +void restore_state_and_detach(pid_t target, unsigned long addr, void* backup, int datasize, struct REG_TYPE oldregs) WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #483: FILE: utils/ptrace.h:1: +#include ERROR: "foo* bar" should be "foo *bar" #496: FILE: utils/ptrace.h:14: +void ptrace_getregs(pid_t target, struct REG_TYPE* regs); WARNING: struct should normally be const #496: FILE: utils/ptrace.h:14: +void ptrace_getregs(pid_t target, struct REG_TYPE* regs); ERROR: "foo* bar" should be "foo *bar" #498: FILE: utils/ptrace.h:16: +void ptrace_setregs(pid_t target, struct REG_TYPE* regs); WARNING: struct should normally be const #498: FILE: utils/ptrace.h:16: +void ptrace_setregs(pid_t target, struct REG_TYPE* regs); WARNING: line over 80 characters #503: FILE: utils/ptrace.h:21: +void restore_state_and_detach(pid_t target, unsigned long addr, void* backup, int datasize, struct REG_TYPE oldregs); ERROR: "foo* bar" should be "foo *bar" #503: FILE: utils/ptrace.h:21: +void restore_state_and_detach(pid_t target, unsigned long addr, void* backup, int datasize, struct REG_TYPE oldregs); WARNING: struct should normally be const #503: FILE: utils/ptrace.h:21: +void restore_state_and_detach(pid_t target, unsigned long addr, void* backup, int datasize, struct REG_TYPE oldregs); total: 39 errors, 38 warnings, 451 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. 0003-utils-Add-utility-for-inject-and-ptrace.patch has style problems, please review. --------------------------------------------------------------- 0004-arch-x86_64-Add-inject.c-to-inject-shared-object-to-.patch --------------------------------------------------------------- WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #29: new file mode 100644 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #34: FILE: arch/x86_64/inject.c:1: +/* WARNING: line over 80 characters #76: FILE: arch/x86_64/inject.c:43: + // save addresses of free() and __libc_dlopen_mode() on the stack for later use WARNING: line over 80 characters #78: FILE: arch/x86_64/inject.c:45: + // rsi is going to contain the address of free(). it's going to get wiped WARNING: line over 80 characters #79: FILE: arch/x86_64/inject.c:46: + // out by the call to malloc(), so save it on the stack for later WARNING: unnecessary whitespace before a quoted newline #80: FILE: arch/x86_64/inject.c:47: + "push %rsi \n" WARNING: line over 80 characters #81: FILE: arch/x86_64/inject.c:48: + // same thing for rdx, which will contain the address of _dl_open() WARNING: line over 80 characters #87: FILE: arch/x86_64/inject.c:54: + // save previous value of r9, because we're going to use it to call malloc() WARNING: unnecessary whitespace before a quoted newline #88: FILE: arch/x86_64/inject.c:55: + "push %r9 \n" WARNING: unnecessary whitespace before a quoted newline #90: FILE: arch/x86_64/inject.c:57: + "mov %rdi,%r9 \n" WARNING: line over 80 characters #91: FILE: arch/x86_64/inject.c:58: + // choose the amount of memory to allocate with malloc() based on the size WARNING: unnecessary whitespace before a quoted newline #93: FILE: arch/x86_64/inject.c:60: + "mov %rcx,%rdi \n" WARNING: unnecessary whitespace before a quoted newline #95: FILE: arch/x86_64/inject.c:62: + "callq *%r9 \n" WARNING: line over 80 characters #96: FILE: arch/x86_64/inject.c:63: + // after returning from malloc(), pop the previous value of r9 off the stack WARNING: unnecessary whitespace before a quoted newline #97: FILE: arch/x86_64/inject.c:64: + "pop %r9 \n" WARNING: line over 80 characters #104: FILE: arch/x86_64/inject.c:71: + // get the address of __libc_dlopen_mode() off of the stack so we can call it WARNING: unnecessary whitespace before a quoted newline #105: FILE: arch/x86_64/inject.c:72: + "pop %rdx \n" WARNING: unnecessary whitespace before a quoted newline #107: FILE: arch/x86_64/inject.c:74: + "push %r9 \n" WARNING: unnecessary whitespace before a quoted newline #109: FILE: arch/x86_64/inject.c:76: + "mov %rdx,%r9 \n" WARNING: line over 80 characters #110: FILE: arch/x86_64/inject.c:77: + // 1st argument to __libc_dlopen_mode(): filename = the address of the buffer returned by malloc() WARNING: unnecessary whitespace before a quoted newline #111: FILE: arch/x86_64/inject.c:78: + "mov %rax,%rdi \n" WARNING: unnecessary whitespace before a quoted newline #113: FILE: arch/x86_64/inject.c:80: + "movabs $1,%rsi \n" WARNING: unnecessary whitespace before a quoted newline #115: FILE: arch/x86_64/inject.c:82: + "callq *%r9 \n" WARNING: unnecessary whitespace before a quoted newline #117: FILE: arch/x86_64/inject.c:84: + "pop %r9 \n" WARNING: line over 80 characters #118: FILE: arch/x86_64/inject.c:85: + // break in so that we can see what __libc_dlopen_mode() returned WARNING: line over 80 characters #130: FILE: arch/x86_64/inject.c:97: + // at this point, rax should still contain our malloc()d buffer from earlier. WARNING: line over 80 characters #131: FILE: arch/x86_64/inject.c:98: + // we're going to free it, so move rax into rdi to make it the first argument to free(). WARNING: unnecessary whitespace before a quoted newline #132: FILE: arch/x86_64/inject.c:99: + "mov %rax,%rdi \n" WARNING: line over 80 characters #133: FILE: arch/x86_64/inject.c:100: + // pop rsi so that we can get the address to free(), which we pushed onto the stack a while ago. WARNING: unnecessary whitespace before a quoted newline #134: FILE: arch/x86_64/inject.c:101: + "pop %rsi \n" WARNING: unnecessary whitespace before a quoted newline #136: FILE: arch/x86_64/inject.c:103: + "push %rbx \n" WARNING: unnecessary whitespace before a quoted newline #138: FILE: arch/x86_64/inject.c:105: + "mov %rsi,%rbx \n" WARNING: line over 80 characters #139: FILE: arch/x86_64/inject.c:106: + // zero out rsi, because free() might think that it contains something that should be freed WARNING: unnecessary whitespace before a quoted newline #140: FILE: arch/x86_64/inject.c:107: + "xor %rsi,%rsi \n" WARNING: line over 80 characters #141: FILE: arch/x86_64/inject.c:108: + // break in so that we can check out the arguments right before making the call WARNING: unnecessary whitespace before a quoted newline #142: FILE: arch/x86_64/inject.c:109: + "int $3 \n" WARNING: unnecessary whitespace before a quoted newline #144: FILE: arch/x86_64/inject.c:111: + "callq *%rbx \n" ERROR: Bad function definition - void inject_shared_lib_end() should probably be void inject_shared_lib_end(void) #163: FILE: arch/x86_64/inject.c:130: +void inject_shared_lib_end() ERROR: "foo* bar" should be "foo *bar" #167: FILE: arch/x86_64/inject.c:134: +int inject(char* libname, pid_t pid) ERROR: "foo* bar" should be "foo *bar" #169: FILE: arch/x86_64/inject.c:136: + char* lib_path = realpath(libname, NULL); ERROR: space required before the open parenthesis '(' #172: FILE: arch/x86_64/inject.c:139: + if(!lib_path) { WARNING: braces {} are not necessary for single statement blocks #172: FILE: arch/x86_64/inject.c:139: + if(!lib_path) { + pr_err_ns("can't find file \"%s\"\n", libname); + } WARNING: struct should normally be const #202: FILE: arch/x86_64/inject.c:169: + struct user_regs_struct oldregs, regs; WARNING: Missing a blank line after declarations #203: FILE: arch/x86_64/inject.c:170: + struct user_regs_struct oldregs, regs; + memset(&oldregs, 0, sizeof(struct user_regs_struct)); WARNING: struct should normally be const #203: FILE: arch/x86_64/inject.c:170: + memset(&oldregs, 0, sizeof(struct user_regs_struct)); WARNING: struct should normally be const #204: FILE: arch/x86_64/inject.c:171: + memset(®s, 0, sizeof(struct user_regs_struct)); WARNING: struct should normally be const #209: FILE: arch/x86_64/inject.c:176: + memcpy(®s, &oldregs, sizeof(struct user_regs_struct)); WARNING: line over 80 characters #231: FILE: arch/x86_64/inject.c:198: + // figure out the size of inject_shared_lib() so we know how big of a buffer to allocate. WARNING: line over 80 characters #232: FILE: arch/x86_64/inject.c:199: + size_t inject_shared_lib_size = (intptr_t)inject_shared_lib_end - (intptr_t)inject_shared_lib; WARNING: line over 80 characters #241: FILE: arch/x86_64/inject.c:208: + intptr_t inject_shared_lib_ret = (intptr_t)find_ret(inject_shared_lib_end) - (intptr_t)inject_shared_lib; ERROR: "foo* bar" should be "foo *bar" #244: FILE: arch/x86_64/inject.c:211: + char* backup = malloc(inject_shared_lib_size * sizeof(char)); WARNING: Missing a blank line after declarations #245: FILE: arch/x86_64/inject.c:212: + char* backup = malloc(inject_shared_lib_size * sizeof(char)); + ptrace_read(target, addr, backup, inject_shared_lib_size); ERROR: "foo* bar" should be "foo *bar" #249: FILE: arch/x86_64/inject.c:216: + char* newcode = malloc(inject_shared_lib_size * sizeof(char)); WARNING: Missing a blank line after declarations #250: FILE: arch/x86_64/inject.c:217: + char* newcode = malloc(inject_shared_lib_size * sizeof(char)); + memset(newcode, 0, inject_shared_lib_size * sizeof(char)); WARNING: struct should normally be const #268: FILE: arch/x86_64/inject.c:235: + struct user_regs_struct malloc_regs; WARNING: Missing a blank line after declarations #269: FILE: arch/x86_64/inject.c:236: + struct user_regs_struct malloc_regs; + memset(&malloc_regs, 0, sizeof(struct user_regs_struct)); WARNING: struct should normally be const #269: FILE: arch/x86_64/inject.c:236: + memset(&malloc_regs, 0, sizeof(struct user_regs_struct)); WARNING: Missing a blank line after declarations #272: FILE: arch/x86_64/inject.c:239: + unsigned long long target_buf = malloc_regs.rax; + if(target_buf == 0) { ERROR: space required before the open parenthesis '(' #272: FILE: arch/x86_64/inject.c:239: + if(target_buf == 0) { WARNING: line over 80 characters #273: FILE: arch/x86_64/inject.c:240: + restore_state_and_detach(target, addr, backup, inject_shared_lib_size, oldregs); WARNING: struct should normally be const #294: FILE: arch/x86_64/inject.c:261: + struct user_regs_struct dlopen_regs; WARNING: Missing a blank line after declarations #295: FILE: arch/x86_64/inject.c:262: + struct user_regs_struct dlopen_regs; + memset(&dlopen_regs, 0, sizeof(struct user_regs_struct)); WARNING: struct should normally be const #295: FILE: arch/x86_64/inject.c:262: + memset(&dlopen_regs, 0, sizeof(struct user_regs_struct)); ERROR: space required before the open parenthesis '(' #301: FILE: arch/x86_64/inject.c:268: + if(lib_addr == 0) { WARNING: line over 80 characters #302: FILE: arch/x86_64/inject.c:269: + restore_state_and_detach(target, addr, backup, inject_shared_lib_size, oldregs); ERROR: space required before the open parenthesis '(' #309: FILE: arch/x86_64/inject.c:276: + if(checkloaded(target, libname)) { WARNING: braces {} are not necessary for any arm of this statement #309: FILE: arch/x86_64/inject.c:276: + if(checkloaded(target, libname)) { [...] + else { [...] ERROR: else should follow close brace '}' #312: FILE: arch/x86_64/inject.c:279: + } + else { WARNING: Prefer using '"%s...", __func__' to using 'inject', this function's name, in a string #313: FILE: arch/x86_64/inject.c:280: + pr_err_ns("could not inject \"%s\"\n", libname); WARNING: line over 80 characters #324: FILE: arch/x86_64/inject.c:291: + restore_state_and_detach(target, addr, backup, inject_shared_lib_size, oldregs); total: 10 errors, 60 warnings, 296 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. 0004-arch-x86_64-Add-inject.c-to-inject-shared-object-to-.patch has style problems, please review. ---------------------------------------------------------- 0005-arch-x86_64-Update-Makefile-to-include-inject.c.patch ---------------------------------------------------------- total: 0 errors, 0 warnings, 7 lines checked 0005-arch-x86_64-Update-Makefile-to-include-inject.c.patch has no obvious style problems and is ready for submission. --------------------------------------------------------------- 0006-utils-Add-env-file-to-support-sharing-environment-ba.patch --------------------------------------------------------------- WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #25: new file mode 100644 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #30: FILE: utils/env-file.c:1: +#include "utils/env-file.h" ERROR: Bad function definition - int create_env_file() should probably be int create_env_file(void) #32: FILE: utils/env-file.c:3: +int create_env_file() { ERROR: open brace '{' following function definitions go on the next line #32: FILE: utils/env-file.c:3: +int create_env_file() { WARNING: Missing a blank line after declarations #34: FILE: utils/env-file.c:5: + int fd; + fd = open(ENV_FILE, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); WARNING: Symbolic permissions 'S_IRUSR | S_IWUSR' are not preferred. Consider using octal permissions '0600'. #34: FILE: utils/env-file.c:5: + fd = open(ENV_FILE, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); ERROR: Bad function definition - int open_env_file() should probably be int open_env_file(void) #43: FILE: utils/env-file.c:14: +int open_env_file() { ERROR: open brace '{' following function definitions go on the next line #43: FILE: utils/env-file.c:14: +int open_env_file() { WARNING: Missing a blank line after declarations #45: FILE: utils/env-file.c:16: + int fd; + fd = open(ENV_FILE, O_RDONLY); ERROR: "foo* bar" should be "foo *bar" #61: FILE: utils/env-file.c:32: +void set_env_to_file(int fd, char* key, char* value) ERROR: "foo* bar" should be "foo *bar" #61: FILE: utils/env-file.c:32: +void set_env_to_file(int fd, char* key, char* value) WARNING: Missing a blank line after declarations #65: FILE: utils/env-file.c:36: + char buf[256]; + sprintf(buf, "%s", key); ERROR: open brace '{' following function definitions go on the next line #74: FILE: utils/env-file.c:45: +void set_env_from_file(int fd) { WARNING: Missing a blank line after declarations #81: FILE: utils/env-file.c:52: + int count = read(fd, buf, 4096); + if (count < 0) { WARNING: braces {} are not necessary for single statement blocks #81: FILE: utils/env-file.c:52: + if (count < 0) { + pr_err_ns(ERROR_READ_FILE); + } WARNING: Missing a blank line after declarations #89: FILE: utils/env-file.c:60: + uint32_t value_index = 0; + for(i=0;buf[i] != '\0';i++) { ERROR: spaces required around that '=' (ctx:VxV) #89: FILE: utils/env-file.c:60: + for(i=0;buf[i] != '\0';i++) { ^ ERROR: space required after that ';' (ctx:VxV) #89: FILE: utils/env-file.c:60: + for(i=0;buf[i] != '\0';i++) { ^ ERROR: space required after that ';' (ctx:VxV) #89: FILE: utils/env-file.c:60: + for(i=0;buf[i] != '\0';i++) { ^ ERROR: space required before the open parenthesis '(' #89: FILE: utils/env-file.c:60: + for(i=0;buf[i] != '\0';i++) { ERROR: space required before the open parenthesis '(' #90: FILE: utils/env-file.c:61: + if(buf[i] == '\n') { WARNING: unnecessary whitespace before a quoted newline #91: FILE: utils/env-file.c:62: + pr_dbg("ENVIRONMENT\t%s : %s \n", key, value); ERROR: spaces required around that '=' (ctx:VxV) #94: FILE: utils/env-file.c:65: + key_index=0; ^ ERROR: space required before the open parenthesis '(' #98: FILE: utils/env-file.c:69: + if(buf[i] == '=') { WARNING: suspect code indent for conditional statements (24, 24) #99: FILE: utils/env-file.c:70: + if (flag) { + flag = false; ERROR: spaces required around that '=' (ctx:VxV) #101: FILE: utils/env-file.c:72: + value_index=0; ^ WARNING: braces {} are not necessary for any arm of this statement #106: FILE: utils/env-file.c:77: + if (flag) { [...] + } else { [...] ERROR: spaces required around that '=' (ctx:VxV) #107: FILE: utils/env-file.c:78: + key[key_index++]=buf[i]; ^ ERROR: spaces required around that '=' (ctx:VxV) #109: FILE: utils/env-file.c:80: + value[value_index++]=buf[i]; ^ WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #121: FILE: utils/env-file.h:1: +#include ERROR: trailing whitespace #132: FILE: utils/env-file.h:12: +"Error occurred while write file.\n" ^I^I^I^I$ WARNING: please, no space before tabs #132: FILE: utils/env-file.h:12: +"Error occurred while write file.\n" ^I^I^I^I$ ERROR: trailing whitespace #135: FILE: utils/env-file.h:15: +"Error occurred while open file.\n" ^I^I^I^I$ WARNING: please, no space before tabs #135: FILE: utils/env-file.h:15: +"Error occurred while open file.\n" ^I^I^I^I$ ERROR: trailing whitespace #138: FILE: utils/env-file.h:18: +"Error occurred while read file.\n" ^I^I^I^I$ WARNING: please, no space before tabs #138: FILE: utils/env-file.h:18: +"Error occurred while read file.\n" ^I^I^I^I$ WARNING: please, no space before tabs #141: FILE: utils/env-file.h:21: +"Error occurred while write file.\n" ^I^I^I^I\$ ERROR: Bad function definition - int create_env_file() should probably be int create_env_file(void) #146: FILE: utils/env-file.h:26: +int create_env_file(); ERROR: Bad function definition - int open_env_file() should probably be int open_env_file(void) #147: FILE: utils/env-file.h:27: +int open_env_file(); ERROR: "foo* bar" should be "foo *bar" #148: FILE: utils/env-file.h:28: +void set_env_to_file(int fd, char* key, char* value); ERROR: "foo* bar" should be "foo *bar" #148: FILE: utils/env-file.h:28: +void set_env_to_file(int fd, char* key, char* value); total: 24 errors, 17 warnings, 114 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. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile 0006-utils-Add-env-file-to-support-sharing-environment-ba.patch has style problems, please review. --------------------------------------------------------------- 0007-mcount-Add-trigger.c-which-implementation-of-libtrig.patch --------------------------------------------------------------- WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #21: new file mode 100644 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #26: FILE: libmcount/trigger.c:1: +#include WARNING: please, no space before tabs #45: FILE: libmcount/trigger.c:20: +"%s does not exist libmcount shared object .\n" ^I^I^I\$ WARNING: unnecessary whitespace before a quoted newline #46: FILE: libmcount/trigger.c:21: +"\tmake sure that the file exists. \n\n" \ WARNING: please, no space before tabs #49: FILE: libmcount/trigger.c:24: +"\tabsolute path of 'libmcount-dynamic.so' not the relative path.\n\n" ^I\$ WARNING: please, no space before tabs #50: FILE: libmcount/trigger.c:25: +"\tfor example:\n" ^I^I^I^I^I^I^I\$ WARNING: unnecessary whitespace before a quoted newline #51: FILE: libmcount/trigger.c:26: +"\t[BADD]./uftrace dynamic -L. --pid=xxxx \n" \ WARNING: unnecessary whitespace before a quoted newline #52: FILE: libmcount/trigger.c:27: +"\t[GOOD]./uftrace dynaimc -L/home/m/uftrace --pid=xxxx \n" WARNING: please, no space before tabs #55: FILE: libmcount/trigger.c:30: +"Cannot access to the %s for saving uftrace datas.\n" ^I^I^I\$ WARNING: please, no space before tabs #56: FILE: libmcount/trigger.c:31: +"\tmake sure that the path exists. \n\n" ^I^I^I^I\$ WARNING: unnecessary whitespace before a quoted newline #56: FILE: libmcount/trigger.c:31: +"\tmake sure that the path exists. \n\n" \ WARNING: please, no space before tabs #59: FILE: libmcount/trigger.c:34: +"\tabsolute path of data-dir.\n\n" ^I^I^I^I^I\$ WARNING: please, no space before tabs #60: FILE: libmcount/trigger.c:35: +"\tfor example:\n" ^I^I^I^I^I^I^I\$ WARNING: please, no space before tabs #61: FILE: libmcount/trigger.c:36: +"\t[BADD]./uftrace dynamic -L/home/m/uftrace --pid=xxxx \n" ^I^I\$ WARNING: unnecessary whitespace before a quoted newline #61: FILE: libmcount/trigger.c:36: +"\t[BADD]./uftrace dynamic -L/home/m/uftrace --pid=xxxx \n" \ WARNING: unnecessary whitespace before a quoted newline #63: FILE: libmcount/trigger.c:38: +"--data=/home/m/uftrace/data --pid=xxxx \n" ERROR: code indent should use tabs where possible #71: FILE: libmcount/trigger.c:46: + int i, len;$ WARNING: please, no spaces at the start of a line #71: FILE: libmcount/trigger.c:46: + int i, len;$ ERROR: code indent should use tabs where possible #73: FILE: libmcount/trigger.c:48: + if (dbg_domain_str == NULL)$ WARNING: please, no spaces at the start of a line #73: FILE: libmcount/trigger.c:48: + if (dbg_domain_str == NULL)$ ERROR: code indent should use tabs where possible #74: FILE: libmcount/trigger.c:49: + return;$ WARNING: please, no spaces at the start of a line #74: FILE: libmcount/trigger.c:49: + return;$ ERROR: code indent should use tabs where possible #76: FILE: libmcount/trigger.c:51: + len = strlen(dbg_domain_str);$ WARNING: please, no spaces at the start of a line #76: FILE: libmcount/trigger.c:51: + len = strlen(dbg_domain_str);$ ERROR: code indent should use tabs where possible #77: FILE: libmcount/trigger.c:52: + for (i = 0; i < len; i += 2) {$ WARNING: please, no spaces at the start of a line #77: FILE: libmcount/trigger.c:52: + for (i = 0; i < len; i += 2) {$ ERROR: code indent should use tabs where possible #78: FILE: libmcount/trigger.c:53: + const char *pos;$ WARNING: please, no spaces at the start of a line #78: FILE: libmcount/trigger.c:53: + const char *pos;$ ERROR: code indent should use tabs where possible #79: FILE: libmcount/trigger.c:54: + char domain = dbg_domain_str[i];$ WARNING: please, no spaces at the start of a line #79: FILE: libmcount/trigger.c:54: + char domain = dbg_domain_str[i];$ ERROR: code indent should use tabs where possible #80: FILE: libmcount/trigger.c:55: + int level = dbg_domain_str[i+1] - '0';$ WARNING: please, no spaces at the start of a line #80: FILE: libmcount/trigger.c:55: + int level = dbg_domain_str[i+1] - '0';$ ERROR: code indent should use tabs where possible #81: FILE: libmcount/trigger.c:56: + int d;$ WARNING: please, no spaces at the start of a line #81: FILE: libmcount/trigger.c:56: + int d;$ ERROR: code indent should use tabs where possible #83: FILE: libmcount/trigger.c:58: + pos = strchr(DBG_DOMAIN_STR, domain);$ WARNING: please, no spaces at the start of a line #83: FILE: libmcount/trigger.c:58: + pos = strchr(DBG_DOMAIN_STR, domain);$ ERROR: code indent should use tabs where possible #84: FILE: libmcount/trigger.c:59: + if (pos == NULL)$ WARNING: please, no spaces at the start of a line #84: FILE: libmcount/trigger.c:59: + if (pos == NULL)$ ERROR: code indent should use tabs where possible #85: FILE: libmcount/trigger.c:60: + continue;$ WARNING: please, no spaces at the start of a line #85: FILE: libmcount/trigger.c:60: + continue;$ ERROR: code indent should use tabs where possible #87: FILE: libmcount/trigger.c:62: + d = pos - DBG_DOMAIN_STR;$ WARNING: please, no spaces at the start of a line #87: FILE: libmcount/trigger.c:62: + d = pos - DBG_DOMAIN_STR;$ ERROR: code indent should use tabs where possible #88: FILE: libmcount/trigger.c:63: + dbg_domain[d] = level;$ WARNING: please, no spaces at the start of a line #88: FILE: libmcount/trigger.c:63: + dbg_domain[d] = level;$ ERROR: code indent should use tabs where possible #89: FILE: libmcount/trigger.c:64: + }$ WARNING: please, no spaces at the start of a line #89: FILE: libmcount/trigger.c:64: + }$ ERROR: Bad function definition - void so_main() should probably be void so_main(void) #92: FILE: libmcount/trigger.c:67: +__attribute__((constructor)) void so_main() { ERROR: open brace '{' following function definitions go on the next line #92: FILE: libmcount/trigger.c:67: +__attribute__((constructor)) void so_main() { ERROR: "foo* bar" should be "foo *bar" #93: FILE: libmcount/trigger.c:68: + char* debug_str; ERROR: "foo* bar" should be "foo *bar" #94: FILE: libmcount/trigger.c:69: + char* preload_library_path; ERROR: "foo* bar" should be "foo *bar" #95: FILE: libmcount/trigger.c:70: + char* data_dir_path; WARNING: struct should normally be const #97: FILE: libmcount/trigger.c:72: + struct stat file; ERROR: code indent should use tabs where possible #102: FILE: libmcount/trigger.c:77: + /*$ ERROR: code indent should use tabs where possible #103: FILE: libmcount/trigger.c:78: + the Process output is delayed for unknown reasons when using$ WARNING: Block comments use * on subsequent lines #103: FILE: libmcount/trigger.c:78: + /* + the Process output is delayed for unknown reasons when using ERROR: code indent should use tabs where possible #104: FILE: libmcount/trigger.c:79: + dynamic tracing. cannot found the reason of delay but below code$ ERROR: code indent should use tabs where possible #105: FILE: libmcount/trigger.c:80: + can mitigation the symptom.$ ERROR: code indent should use tabs where possible #106: FILE: libmcount/trigger.c:81: + */$ ERROR: code indent should use tabs where possible #107: FILE: libmcount/trigger.c:82: + setvbuf(stdout, NULL, _IONBF, 1024);$ WARNING: please, no spaces at the start of a line #107: FILE: libmcount/trigger.c:82: + setvbuf(stdout, NULL, _IONBF, 1024);$ ERROR: code indent should use tabs where possible #108: FILE: libmcount/trigger.c:83: + setvbuf(stderr, NULL, _IONBF, 1024);$ WARNING: please, no spaces at the start of a line #108: FILE: libmcount/trigger.c:83: + setvbuf(stderr, NULL, _IONBF, 1024);$ WARNING: braces {} are not necessary for single statement blocks #111: FILE: libmcount/trigger.c:86: + if (fd_envfile < 0) { + printf(ERROR_ENVFILE_NOT_EXIST, ENV_FILE); + } ERROR: code indent should use tabs where possible #119: FILE: libmcount/trigger.c:94: + if (debug_str) {$ WARNING: please, no spaces at the start of a line #119: FILE: libmcount/trigger.c:94: + if (debug_str) {$ ERROR: code indent should use tabs where possible #120: FILE: libmcount/trigger.c:95: + debug = strtol(debug_str, NULL, 0);$ WARNING: please, no spaces at the start of a line #120: FILE: libmcount/trigger.c:95: + debug = strtol(debug_str, NULL, 0);$ ERROR: code indent should use tabs where possible #121: FILE: libmcount/trigger.c:96: + build_debug_domain(getenv("UFTRACE_DEBUG_DOMAIN"));$ WARNING: please, no spaces at the start of a line #121: FILE: libmcount/trigger.c:96: + build_debug_domain(getenv("UFTRACE_DEBUG_DOMAIN"));$ ERROR: code indent should use tabs where possible #122: FILE: libmcount/trigger.c:97: + }$ WARNING: please, no spaces at the start of a line #122: FILE: libmcount/trigger.c:97: + }$ WARNING: braces {} are not necessary for any arm of this statement #127: FILE: libmcount/trigger.c:102: + if (stat(data_dir_path, &file) == 0) { [...] + } else { [...] WARNING: braces {} are not necessary for any arm of this statement #133: FILE: libmcount/trigger.c:108: + if (stat(preload_library_path, &file) == 0) { [...] + } else { [...] ERROR: "foo* bar" should be "foo *bar" #139: FILE: libmcount/trigger.c:114: + void* handle = dlopen(preload_library_path, RTLD_LAZY); WARNING: Missing a blank line after declarations #140: FILE: libmcount/trigger.c:115: + void* handle = dlopen(preload_library_path, RTLD_LAZY); + if (!handle) { WARNING: braces {} are not necessary for single statement blocks #140: FILE: libmcount/trigger.c:115: + if (!handle) { + pr_err_ns("%s\n", dlerror()); + } ERROR: code indent should use tabs where possible #142: FILE: libmcount/trigger.c:117: + }$ WARNING: please, no spaces at the start of a line #142: FILE: libmcount/trigger.c:117: + }$ total: 33 errors, 45 warnings, 120 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. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile 0007-mcount-Add-trigger.c-which-implementation-of-libtrig.patch has style problems, please review. ----------------------------------------------------------- 0008-uftrace-Modify-uftrace-to-add-command-and-option.patch ----------------------------------------------------------- WARNING: braces {} are not necessary for single statement blocks #42: FILE: uftrace.c:545: + if (opts->pid <= 0) { + pr_use("invalid pid number: %s (ignoring..)\n", arg); + } WARNING: struct should normally be const #101: FILE: uftrace.h:273: +int command_dynamic(int argc, char *argv[], struct opts *opts); total: 0 errors, 2 warnings, 73 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. 0008-uftrace-Modify-uftrace-to-add-command-and-option.patch has style problems, please review. ------------------------------------ 0009-dynamic-Add-cmd-dynamic.c.patch ------------------------------------ WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #17: new file mode 100644 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #22: FILE: cmd-dynamic.c:1: +#include WARNING: externs should be avoided in .c files #63: FILE: cmd-dynamic.c:42: +extern int do_main_loop(int pfd[2], int ready, struct opts *opts, int pid); WARNING: struct should normally be const #63: FILE: cmd-dynamic.c:42: +extern int do_main_loop(int pfd[2], int ready, struct opts *opts, int pid); WARNING: externs should be avoided in .c files #64: FILE: cmd-dynamic.c:43: +extern bool check_linux_schedule_event(char *events, WARNING: externs should be avoided in .c files #66: FILE: cmd-dynamic.c:45: +extern bool check_linux_perf_event(char *events); WARNING: externs should be avoided in .c files #67: FILE: cmd-dynamic.c:46: +extern char *build_debug_domain_string(void); ERROR: "foo* bar" should be "foo *bar" #68: FILE: cmd-dynamic.c:47: +extern int inject(char* libname, pid_t pid); WARNING: externs should be avoided in .c files #68: FILE: cmd-dynamic.c:47: +extern int inject(char* libname, pid_t pid); WARNING: unnecessary whitespace before a quoted newline #71: FILE: cmd-dynamic.c:50: +"you must specify LD_PRELOAD path by using '-L' option if want use \n" \ WARNING: struct should normally be const #80: FILE: cmd-dynamic.c:59: +static void make_uftrace_environ_file(struct opts *opts, int pfd) WARNING: braces {} are not necessary for single statement blocks #91: FILE: cmd-dynamic.c:70: + if (opts->pid) { + method = DYNAMIC_TO_PROCESS; + } WARNING: braces {} are not necessary for single statement blocks #99: FILE: cmd-dynamic.c:78: + if (method == DYNAMIC_TO_PROCESS) { + pr_err_ns(ERROR_WITHOUT_LDPRELOAD); + } ERROR: else should follow close brace '}' #119: FILE: cmd-dynamic.c:98: + } + else { WARNING: braces {} are not necessary for single statement blocks #150: FILE: cmd-dynamic.c:129: + if (opts->auto_args) { + set_env_to_file(env_fd, "UFTRACE_AUTO_ARGS", "1"); + } WARNING: braces {} are not necessary for single statement blocks #195: FILE: cmd-dynamic.c:174: + if (opts->nest_libcall) { + set_env_to_file(env_fd, "UFTRACE_NEST_LIBCALL", "1"); + } WARNING: braces {} are not necessary for single statement blocks #200: FILE: cmd-dynamic.c:179: + if (strcmp(opts->dirname, UFTRACE_DIR_NAME)) { + set_env_to_file(env_fd, "UFTRACE_DIR", opts->dirname); + } WARNING: line over 80 characters #221: FILE: cmd-dynamic.c:200: + set_env_to_file(env_fd, "UFTRACE_DEBUG_DOMAIN", build_debug_domain_string()); ERROR: space required before the open parenthesis '(' #224: FILE: cmd-dynamic.c:203: + if(opts->disabled) { WARNING: braces {} are not necessary for single statement blocks #224: FILE: cmd-dynamic.c:203: + if(opts->disabled) { + set_env_to_file(env_fd, "UFTRACE_DISABLED", "1"); + } WARNING: braces {} are not necessary for single statement blocks #241: FILE: cmd-dynamic.c:220: + if (opts->script_file) { + set_env_to_file(env_fd, "UFTRACE_SCRIPT", opts->script_file); + } ERROR: else should follow close brace '}' #262: FILE: cmd-dynamic.c:241: + } + else { WARNING: struct should normally be const #276: FILE: cmd-dynamic.c:255: +void setup_uftrace_environ(struct opts *opts, int pfd) ERROR: "foo* bar" should be "foo *bar" #282: FILE: cmd-dynamic.c:261: +char* get_libtrigger_path(struct opts *opts) WARNING: struct should normally be const #282: FILE: cmd-dynamic.c:261: +char* get_libtrigger_path(struct opts *opts) ERROR: code indent should use tabs where possible #286: FILE: cmd-dynamic.c:265: + if (opts->lib_path) {$ WARNING: please, no spaces at the start of a line #286: FILE: cmd-dynamic.c:265: + if (opts->lib_path) {$ WARNING: line over 80 characters #287: FILE: cmd-dynamic.c:266: + snprintf(lib, PATH_MAX, "%s/libmcount/%s", opts->lib_path, libtrigger); ERROR: code indent should use tabs where possible #287: FILE: cmd-dynamic.c:266: + snprintf(lib, PATH_MAX, "%s/libmcount/%s", opts->lib_path, libtrigger);$ WARNING: please, no spaces at the start of a line #287: FILE: cmd-dynamic.c:266: + snprintf(lib, PATH_MAX, "%s/libmcount/%s", opts->lib_path, libtrigger);$ ERROR: code indent should use tabs where possible #289: FILE: cmd-dynamic.c:268: + if (access(lib, F_OK) == 0) {$ WARNING: please, no spaces at the start of a line #289: FILE: cmd-dynamic.c:268: + if (access(lib, F_OK) == 0) {$ ERROR: code indent should use tabs where possible #290: FILE: cmd-dynamic.c:269: + return lib;$ WARNING: please, no spaces at the start of a line #290: FILE: cmd-dynamic.c:269: + return lib;$ ERROR: code indent should use tabs where possible #291: FILE: cmd-dynamic.c:270: + }$ WARNING: please, no spaces at the start of a line #291: FILE: cmd-dynamic.c:270: + }$ ERROR: code indent should use tabs where possible #292: FILE: cmd-dynamic.c:271: + else if (errno == ENOENT) {$ WARNING: please, no spaces at the start of a line #292: FILE: cmd-dynamic.c:271: + else if (errno == ENOENT) {$ ERROR: else should follow close brace '}' #292: FILE: cmd-dynamic.c:271: + } + else if (errno == ENOENT) { WARNING: line over 80 characters #293: FILE: cmd-dynamic.c:272: + snprintf(lib, PATH_MAX, "%s/%s", opts->lib_path, libtrigger); if (access(lib, F_OK) == 0) ERROR: code indent should use tabs where possible #293: FILE: cmd-dynamic.c:272: + snprintf(lib, PATH_MAX, "%s/%s", opts->lib_path, libtrigger); if (access(lib, F_OK) == 0)$ WARNING: please, no spaces at the start of a line #293: FILE: cmd-dynamic.c:272: + snprintf(lib, PATH_MAX, "%s/%s", opts->lib_path, libtrigger); if (access(lib, F_OK) == 0)$ ERROR: trailing statements should be on next line #293: FILE: cmd-dynamic.c:272: + snprintf(lib, PATH_MAX, "%s/%s", opts->lib_path, libtrigger); if (access(lib, F_OK) == 0) ERROR: code indent should use tabs where possible #294: FILE: cmd-dynamic.c:273: + return lib;$ WARNING: please, no spaces at the start of a line #294: FILE: cmd-dynamic.c:273: + return lib;$ ERROR: code indent should use tabs where possible #295: FILE: cmd-dynamic.c:274: + }$ WARNING: please, no spaces at the start of a line #295: FILE: cmd-dynamic.c:274: + }$ ERROR: code indent should use tabs where possible #296: FILE: cmd-dynamic.c:275: + free(lib);$ WARNING: please, no spaces at the start of a line #296: FILE: cmd-dynamic.c:275: + free(lib);$ ERROR: code indent should use tabs where possible #297: FILE: cmd-dynamic.c:276: + return NULL;$ WARNING: please, no spaces at the start of a line #297: FILE: cmd-dynamic.c:276: + return NULL;$ ERROR: code indent should use tabs where possible #298: FILE: cmd-dynamic.c:277: + }$ WARNING: please, no spaces at the start of a line #298: FILE: cmd-dynamic.c:277: + }$ ERROR: code indent should use tabs where possible #301: FILE: cmd-dynamic.c:280: + snprintf(lib, PATH_MAX, "%s/%s", INSTALL_LIB_PATH, libtrigger);$ WARNING: please, no spaces at the start of a line #301: FILE: cmd-dynamic.c:280: + snprintf(lib, PATH_MAX, "%s/%s", INSTALL_LIB_PATH, libtrigger);$ ERROR: code indent should use tabs where possible #302: FILE: cmd-dynamic.c:281: + if (access(lib, F_OK) != 0 && errno == ENOENT)$ WARNING: please, no spaces at the start of a line #302: FILE: cmd-dynamic.c:281: + if (access(lib, F_OK) != 0 && errno == ENOENT)$ ERROR: code indent should use tabs where possible #303: FILE: cmd-dynamic.c:282: + pr_warn("Didn't you run 'make install' ?\n");$ WARNING: please, no spaces at the start of a line #303: FILE: cmd-dynamic.c:282: + pr_warn("Didn't you run 'make install' ?\n");$ ERROR: code indent should use tabs where possible #305: FILE: cmd-dynamic.c:284: + strcpy(lib, libtrigger);$ WARNING: please, no spaces at the start of a line #305: FILE: cmd-dynamic.c:284: + strcpy(lib, libtrigger);$ WARNING: struct should normally be const #325: FILE: cmd-dynamic.c:304: +void do_inject(int pfd[2], int ready, struct opts *opts, char *argv[]) ERROR: "foo* bar" should be "foo *bar" #328: FILE: cmd-dynamic.c:307: + char* libtrigger_path; ERROR: code indent should use tabs where possible #329: FILE: cmd-dynamic.c:308: + uint64_t dummy;$ WARNING: please, no spaces at the start of a line #329: FILE: cmd-dynamic.c:308: + uint64_t dummy;$ ERROR: code indent should use tabs where possible #330: FILE: cmd-dynamic.c:309: + close(pfd[0]);$ WARNING: Missing a blank line after declarations #330: FILE: cmd-dynamic.c:309: + uint64_t dummy; + close(pfd[0]); WARNING: please, no spaces at the start of a line #330: FILE: cmd-dynamic.c:309: + close(pfd[0]);$ ERROR: code indent should use tabs where possible #333: FILE: cmd-dynamic.c:312: + if (read(ready, &dummy, sizeof(dummy)) != (ssize_t)sizeof(dummy))$ WARNING: please, no spaces at the start of a line #333: FILE: cmd-dynamic.c:312: + if (read(ready, &dummy, sizeof(dummy)) != (ssize_t)sizeof(dummy))$ ERROR: code indent should use tabs where possible #334: FILE: cmd-dynamic.c:313: + pr_err("waiting for parent failed");$ WARNING: please, no spaces at the start of a line #334: FILE: cmd-dynamic.c:313: + pr_err("waiting for parent failed");$ ERROR: space required before the open parenthesis '(' #338: FILE: cmd-dynamic.c:317: + if(libtrigger_path == NULL) WARNING: Block comments use * on subsequent lines #345: FILE: cmd-dynamic.c:324: +/* +find the executable file for the process you want to inject. WARNING: 'informations' may be misspelled - perhaps 'information'? #346: FILE: cmd-dynamic.c:325: +Local symbol informations are required to use dynamic tracing. ERROR: open brace '{' following function definitions go on the next line #348: FILE: cmd-dynamic.c:327: +int find_exefile(struct opts *opts) { WARNING: struct should normally be const #348: FILE: cmd-dynamic.c:327: +int find_exefile(struct opts *opts) { ERROR: "foo* bar" should be "foo *bar" #350: FILE: cmd-dynamic.c:329: + char* exePath; ERROR: space required before the open parenthesis '(' #361: FILE: cmd-dynamic.c:340: + if(len == -1) { ERROR: exactly one space required after that #ifndef #388: FILE: cmd-dynamic.c:367: +#ifndef EM_AARCH64 WARNING: struct should normally be const #392: FILE: cmd-dynamic.c:371: +static void check_binary_dynamic_avilable(struct opts *opts) WARNING: braces {} are not necessary for single statement blocks #407: FILE: cmd-dynamic.c:386: + if (errno == ENOENT && opts->exename[0] != '/') { + pr_err_ns(UFTRACE_MSG, opts->exename, opts->exename); + } WARNING: struct should normally be const #450: FILE: cmd-dynamic.c:429: +int command_dynamic(int argc, char *argv[], struct opts *opts) ERROR: code indent should use tabs where possible #488: FILE: cmd-dynamic.c:467: + if (pid < 0)$ WARNING: please, no spaces at the start of a line #488: FILE: cmd-dynamic.c:467: + if (pid < 0)$ ERROR: code indent should use tabs where possible #489: FILE: cmd-dynamic.c:468: + pr_err("cannot start child process");$ WARNING: please, no spaces at the start of a line #489: FILE: cmd-dynamic.c:468: + pr_err("cannot start child process");$ total: 35 errors, 52 warnings, 476 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. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile 0009-dynamic-Add-cmd-dynamic.c.patch has style problems, please review. ------------------------------------------------ 0010-mcount-Add-libmcount-mcount-dynamic.c.patch ------------------------------------------------ WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #19: new file mode 100644 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #24: FILE: libmcount/mcount-dynamic.c:1: +#include ERROR: Bad function definition - void pre_startup() should probably be void pre_startup(void) #53: FILE: libmcount/mcount-dynamic.c:30: +void pre_startup() WARNING: Missing a blank line after declarations #56: FILE: libmcount/mcount-dynamic.c:33: + int fd_envfile; + fd_envfile = open_env_file(); ERROR: Bad function definition - void config_for_dynamic() should probably be void config_for_dynamic(void) #71: FILE: libmcount/mcount-dynamic.c:48: +void config_for_dynamic() { ERROR: open brace '{' following function definitions go on the next line #71: FILE: libmcount/mcount-dynamic.c:48: +void config_for_dynamic() { WARNING: struct should normally be const #76: FILE: libmcount/mcount-dynamic.c:53: + struct stat statbuf; WARNING: braces {} are not necessary for single statement blocks #82: FILE: libmcount/mcount-dynamic.c:59: + if (uftrace_pid == 0) { + pr_err_ns("Cannot parse UFTRACE_PID from environment. \n"); + } WARNING: line over 80 characters #83: FILE: libmcount/mcount-dynamic.c:60: + pr_err_ns("Cannot parse UFTRACE_PID from environment. \n"); WARNING: unnecessary whitespace before a quoted newline #83: FILE: libmcount/mcount-dynamic.c:60: + pr_err_ns("Cannot parse UFTRACE_PID from environment. \n"); WARNING: unnecessary whitespace before a quoted newline #86: FILE: libmcount/mcount-dynamic.c:63: + pr_err_ns("Cannot found UFTRACE_PID from environment. \n"); WARNING: line over 80 characters #94: FILE: libmcount/mcount-dynamic.c:71: + snprintf(fd_path, sizeof(fd_path), "/proc/%d/fd/%d", uftrace_pid, pfd); WARNING: Missing a blank line after declarations #94: FILE: libmcount/mcount-dynamic.c:71: + char fd_path[64]; + snprintf(fd_path, sizeof(fd_path), "/proc/%d/fd/%d", uftrace_pid, pfd); ERROR: Bad function definition - void post_startup() should probably be void post_startup(void) #108: FILE: libmcount/mcount-dynamic.c:85: +void post_startup() total: 4 errors, 10 warnings, 92 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. 0010-mcount-Add-libmcount-mcount-dynamic.c.patch has style problems, please review. --------------------------------------------------------------- 0011-build-Update-Makefile-to-support-build-with-dynamic-.patch --------------------------------------------------------------- ERROR: Missing Signed-off-by: line(s) total: 1 errors, 0 warnings, 52 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. 0011-build-Update-Makefile-to-support-build-with-dynamic-.patch has style problems, please review. --- all --- WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #76: #145: FILE: utils/inject-utils.c:111: [1495/1870] ERROR: Does not appear to be a unified-diff format patch total: 1 errors, 1 warnings, 0 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. all has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.