Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argument parsers improvements #4279

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Commits on Sep 27, 2024

  1. Configuration menu
    Copy the full SHA
    27e0a3a View commit details
    Browse the repository at this point in the history
  2. chore: use system values from C includes

    Try as much as possible to use values defined in the C system, avoiding
    entering incorrect values.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    d9aba07 View commit details
    Browse the repository at this point in the history
  3. perf: improve ParseCloneFlags

    Iterate slice instead of conditional branch.
    
    Return string only instead of the Argument type since it's the only
    value used.
    
    | BenchmarkParseCloneFlags-32 | Before   | After  |
    |-----------------------------|----------|--------|
    | Execution Time (ns/op)      | 1117     | 696.7  |
    | Memory Allocated (B/op)     | 1192     | 736    |
    | Allocations per Operation   | 27       | 25     |
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    a2e372d View commit details
    Browse the repository at this point in the history
  4. perf: fix: improve ParseOpenFlagArgument

    When possible iterates slice instead of conditional branch.
    Return string only instead of the Argument type since it's the only
    value used.
    
    Fix logic, since it wasn't printing O_RDONLY flag alone.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    f506f52 View commit details
    Browse the repository at this point in the history
  5. perf: fix: improve ParseAccessMode

    Iterate slice instead of conditional branch.
    
    Return string only instead of the Argument type since it's the only
    value used.
    
    Fix logic, since it wasn't printing F_OK flag alone.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    ad4d395 View commit details
    Browse the repository at this point in the history
  6. feat: perf: fix: AT flags parsing

    Introduce ParseFaccessatFlag to parse faccessat flags.
    Introduce ParseFchmodatFlag to parse fchmodat flags.
    
    Iterate slice instead of conditional branch.
    
    Return string only instead of the Argument type since it's the only
    value used.
    
    Fix ParseExecFlag (now ParseExecveatFlag) to check only related flags.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    5ed2ede View commit details
    Browse the repository at this point in the history
  7. perf: chore: add missing flags to ParseCapability

    Add missing flags to ParseCapability:
    CAP_PERFMON, CAP_BPF and CAP_CHECKPOINT_RESTORE
    
    Use slice instead of maps. This allows for direct access to values via
    index.
    
    Return string only instead of the Argument type since it's the only
    value used.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    31142af View commit details
    Browse the repository at this point in the history
  8. perf: chore: add missing flags to ParsePrctlOption

    Add missing flags to ParsePrctlOption:
        PR_SET_IO_FLUSHER, PR_GET_IO_FLUSHER, PR_SET_SYSCALL_USER_DISPATCH,
        PR_PAC_SET_ENABLED_KEYS, PR_PAC_GET_ENABLED_KEYS, PR_SCHED_CORE,
        PR_SME_SET_VL, PR_SME_GET_VL, PR_SET_MDWE, PR_GET_MDWE,
        PR_SET_MEMORY_MERGE and PR_GET_MEMORY_MERGE.
    
    Iterate slice instead of fetching a map.
    
    Return string only instead of the Argument type since it's the only
    value used.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    7ad7f85 View commit details
    Browse the repository at this point in the history
  9. perf: chore: add missing flags to ParseBPFCmd

    Add missing flags to ParseBPFCmd:
        BPF_PROG_BIND_MAP, BPF_TOKEN_CREATE
    
    Use slice instead of maps. This allows for direct access to values via
    index.
    
    Return string only instead of the Argument type since it's the only
    value used.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    87c9b54 View commit details
    Browse the repository at this point in the history
  10. perf: chore: add flags ParsePtraceRequestArgument

    Add missing flags to ParsePtraceRequestArgument:
        PTRACE_GET_THREAD_AREA, PTRACE_SET_THREAD_AREA, PTRACE_ARCH_PRCTL,
        PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP, PTRACE_SINGLEBLOCK,
        PTRACE_GET_RSEQ_CONFIGURATION,
        PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG and
        PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG.
    
    Iterate slice instead of fetching a map.
    
    Return string only instead of the Argument type since it's the only
    value used.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    fc9f769 View commit details
    Browse the repository at this point in the history
  11. perf: chore: improve ParseSocketcallCall

    Use slice instead of maps. This allows for direct access to values via
    index.
    
    Return string only instead of the Argument type since it's the only
    value used.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    1a07477 View commit details
    Browse the repository at this point in the history
  12. perf: chore: add flag to ParseSocketDomainArgument

    Add missing flag to ParseSocketDomainArgument:
        AF_MCTP
    
    Use slice instead of maps. This allows for direct access to values via
    index.
    
    Return string only instead of the Argument type since it's the only
    value used.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    961a3c8 View commit details
    Browse the repository at this point in the history
  13. feat: parse dirfd for special case AT_FDCWD

    syscalls with dirfd arg now parse for special case AT_FDCWD when
    ParseArgumentsFDs is true.
    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    c73924e View commit details
    Browse the repository at this point in the history
  14. chore: add todo comment

    geyslan committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    32999c7 View commit details
    Browse the repository at this point in the history