github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/utils/syscalls/syscalls_amd64.go (about) 1 // Copyright 2023 The Inspektor Gadget authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package syscalls 16 17 // This is updated to kernel 6.6-rc2 18 var syscallsNameToNumber = map[string]int{ 19 "_sysctl": 156, 20 "accept": 43, 21 "accept4": 288, 22 "access": 21, 23 "acct": 163, 24 "add_key": 248, 25 "adjtimex": 159, 26 "alarm": 37, 27 "arch_prctl": 158, 28 "bind": 49, 29 "bpf": 321, 30 "brk": 12, 31 "cachestat": 451, 32 "capget": 125, 33 "capset": 126, 34 "chdir": 80, 35 "chmod": 90, 36 "chown": 92, 37 "chroot": 161, 38 "clock_adjtime": 305, 39 "clock_getres": 229, 40 "clock_gettime": 228, 41 "clock_nanosleep": 230, 42 "clock_settime": 227, 43 "clone": 56, 44 "clone3": 435, 45 "close": 3, 46 "close_range": 436, 47 "connect": 42, 48 "copy_file_range": 326, 49 "creat": 85, 50 "create_module": 174, 51 "delete_module": 176, 52 "dup": 32, 53 "dup2": 33, 54 "dup3": 292, 55 "epoll_create": 213, 56 "epoll_create1": 291, 57 "epoll_ctl": 233, 58 "epoll_ctl_old": 214, 59 "epoll_pwait": 281, 60 "epoll_pwait2": 441, 61 "epoll_wait": 232, 62 "epoll_wait_old": 215, 63 "eventfd": 284, 64 "eventfd2": 290, 65 "execve": 59, 66 "execveat": 322, 67 "exit": 60, 68 "exit_group": 231, 69 "faccessat": 269, 70 "faccessat2": 439, 71 "fadvise64": 221, 72 "fallocate": 285, 73 "fanotify_init": 300, 74 "fanotify_mark": 301, 75 "fchdir": 81, 76 "fchmod": 91, 77 "fchmodat": 268, 78 "fchown": 93, 79 "fchownat": 260, 80 "fcntl": 72, 81 "fdatasync": 75, 82 "fgetxattr": 193, 83 "finit_module": 313, 84 "flistxattr": 196, 85 "flock": 73, 86 "fork": 57, 87 "fremovexattr": 199, 88 "fsconfig": 431, 89 "fsetxattr": 190, 90 "fsmount": 432, 91 "fsopen": 430, 92 "fspick": 433, 93 "fstat": 5, 94 "fstatfs": 138, 95 "fsync": 74, 96 "ftruncate": 77, 97 "futex": 202, 98 "futex_waitv": 449, 99 "futimesat": 261, 100 "get_kernel_syms": 177, 101 "get_mempolicy": 239, 102 "get_robust_list": 274, 103 "get_thread_area": 211, 104 "getcpu": 309, 105 "getcwd": 79, 106 "getdents": 78, 107 "getdents64": 217, 108 "getegid": 108, 109 "geteuid": 107, 110 "getgid": 104, 111 "getgroups": 115, 112 "getitimer": 36, 113 "getpeername": 52, 114 "getpgid": 121, 115 "getpgrp": 111, 116 "getpid": 39, 117 "getpmsg": 181, 118 "getppid": 110, 119 "getpriority": 140, 120 "getrandom": 318, 121 "getresgid": 120, 122 "getresuid": 118, 123 "getrlimit": 97, 124 "getrusage": 98, 125 "getsid": 124, 126 "getsockname": 51, 127 "getsockopt": 55, 128 "gettid": 186, 129 "gettimeofday": 96, 130 "getuid": 102, 131 "getxattr": 191, 132 "init_module": 175, 133 "inotify_add_watch": 254, 134 "inotify_init": 253, 135 "inotify_init1": 294, 136 "inotify_rm_watch": 255, 137 "io_cancel": 210, 138 "io_destroy": 207, 139 "io_getevents": 208, 140 "io_pgetevents": 333, 141 "io_setup": 206, 142 "io_submit": 209, 143 "io_uring_enter": 426, 144 "io_uring_register": 427, 145 "io_uring_setup": 425, 146 "ioctl": 16, 147 "ioperm": 173, 148 "iopl": 172, 149 "ioprio_get": 252, 150 "ioprio_set": 251, 151 "kcmp": 312, 152 "kexec_file_load": 320, 153 "kexec_load": 246, 154 "keyctl": 250, 155 "kill": 62, 156 "landlock_add_rule": 445, 157 "landlock_create_ruleset": 444, 158 "landlock_restrict_self": 446, 159 "lchown": 94, 160 "lgetxattr": 192, 161 "link": 86, 162 "linkat": 265, 163 "listen": 50, 164 "listxattr": 194, 165 "llistxattr": 195, 166 "lookup_dcookie": 212, 167 "lremovexattr": 198, 168 "lseek": 8, 169 "lsetxattr": 189, 170 "lstat": 6, 171 "madvise": 28, 172 "mbind": 237, 173 "membarrier": 324, 174 "memfd_create": 319, 175 "memfd_secret": 447, 176 "migrate_pages": 256, 177 "mincore": 27, 178 "mkdir": 83, 179 "mkdirat": 258, 180 "mknod": 133, 181 "mknodat": 259, 182 "mlock": 149, 183 "mlock2": 325, 184 "mlockall": 151, 185 "mmap": 9, 186 "modify_ldt": 154, 187 "mount": 165, 188 "mount_setattr": 442, 189 "move_mount": 429, 190 "move_pages": 279, 191 "mprotect": 10, 192 "mq_getsetattr": 245, 193 "mq_notify": 244, 194 "mq_open": 240, 195 "mq_timedreceive": 243, 196 "mq_timedsend": 242, 197 "mq_unlink": 241, 198 "mremap": 25, 199 "msgctl": 71, 200 "msgget": 68, 201 "msgrcv": 70, 202 "msgsnd": 69, 203 "msync": 26, 204 "munlock": 150, 205 "munlockall": 152, 206 "munmap": 11, 207 "name_to_handle_at": 303, 208 "nanosleep": 35, 209 "newfstatat": 262, 210 "nfsservctl": 180, 211 "open": 2, 212 "open_by_handle_at": 304, 213 "open_tree": 428, 214 "openat": 257, 215 "openat2": 437, 216 "pause": 34, 217 "perf_event_open": 298, 218 "personality": 135, 219 "pidfd_getfd": 438, 220 "pidfd_open": 434, 221 "pidfd_send_signal": 424, 222 "pipe": 22, 223 "pipe2": 293, 224 "pivot_root": 155, 225 "pkey_alloc": 330, 226 "pkey_free": 331, 227 "pkey_mprotect": 329, 228 "poll": 7, 229 "ppoll": 271, 230 "prctl": 157, 231 "pread64": 17, 232 "preadv": 295, 233 "preadv2": 327, 234 "prlimit64": 302, 235 "process_madvise": 440, 236 "process_mrelease": 448, 237 "process_vm_readv": 310, 238 "process_vm_writev": 311, 239 "pselect6": 270, 240 "ptrace": 101, 241 "pwrite64": 18, 242 "pwritev": 296, 243 "pwritev2": 328, 244 "query_module": 178, 245 "quotactl": 179, 246 "quotactl_fd": 443, 247 "read": 0, 248 "readahead": 187, 249 "readlink": 89, 250 "readlinkat": 267, 251 "readv": 19, 252 "reboot": 169, 253 "recvfrom": 45, 254 "recvmmsg": 299, 255 "recvmsg": 47, 256 "remap_file_pages": 216, 257 "removexattr": 197, 258 "rename": 82, 259 "renameat": 264, 260 "renameat2": 316, 261 "request_key": 249, 262 "restart_syscall": 219, 263 "rmdir": 84, 264 "rseq": 334, 265 "rt_sigaction": 13, 266 "rt_sigpending": 127, 267 "rt_sigprocmask": 14, 268 "rt_sigqueueinfo": 129, 269 "rt_sigreturn": 15, 270 "rt_sigsuspend": 130, 271 "rt_sigtimedwait": 128, 272 "rt_tgsigqueueinfo": 297, 273 "sched_get_priority_max": 146, 274 "sched_get_priority_min": 147, 275 "sched_getaffinity": 204, 276 "sched_getattr": 315, 277 "sched_getparam": 143, 278 "sched_getscheduler": 145, 279 "sched_rr_get_interval": 148, 280 "sched_setaffinity": 203, 281 "sched_setattr": 314, 282 "sched_setparam": 142, 283 "sched_setscheduler": 144, 284 "sched_yield": 24, 285 "seccomp": 317, 286 "select": 23, 287 "semctl": 66, 288 "semget": 64, 289 "semop": 65, 290 "semtimedop": 220, 291 "sendfile": 40, 292 "sendmmsg": 307, 293 "sendmsg": 46, 294 "sendto": 44, 295 "set_mempolicy": 238, 296 "set_mempolicy_home_node": 450, 297 "set_robust_list": 273, 298 "set_thread_area": 205, 299 "set_tid_address": 218, 300 "setdomainname": 171, 301 "setfsgid": 123, 302 "setfsuid": 122, 303 "setgid": 106, 304 "setgroups": 116, 305 "sethostname": 170, 306 "setitimer": 38, 307 "setns": 308, 308 "setpgid": 109, 309 "setpriority": 141, 310 "setregid": 114, 311 "setresgid": 119, 312 "setresuid": 117, 313 "setreuid": 113, 314 "setrlimit": 160, 315 "setsid": 112, 316 "setsockopt": 54, 317 "settimeofday": 164, 318 "setuid": 105, 319 "setxattr": 188, 320 "shmat": 30, 321 "shmctl": 31, 322 "shmdt": 67, 323 "shmget": 29, 324 "shutdown": 48, 325 "sigaltstack": 131, 326 "signalfd": 282, 327 "signalfd4": 289, 328 "socket": 41, 329 "socketpair": 53, 330 "splice": 275, 331 "stat": 4, 332 "statfs": 137, 333 "statx": 332, 334 "swapoff": 168, 335 "swapon": 167, 336 "symlink": 88, 337 "symlinkat": 266, 338 "sync": 162, 339 "sync_file_range": 277, 340 "syncfs": 306, 341 "sysfs": 139, 342 "sysinfo": 99, 343 "syslog": 103, 344 "tee": 276, 345 "tgkill": 234, 346 "time": 201, 347 "timer_create": 222, 348 "timer_delete": 226, 349 "timer_getoverrun": 225, 350 "timer_gettime": 224, 351 "timer_settime": 223, 352 "timerfd_create": 283, 353 "timerfd_gettime": 287, 354 "timerfd_settime": 286, 355 "times": 100, 356 "tkill": 200, 357 "truncate": 76, 358 "umask": 95, 359 "umount2": 166, 360 "uname": 63, 361 "unlink": 87, 362 "unlinkat": 263, 363 "unshare": 272, 364 "uselib": 134, 365 "userfaultfd": 323, 366 "ustat": 136, 367 "utime": 132, 368 "utimensat": 280, 369 "utimes": 235, 370 "vfork": 58, 371 "vhangup": 153, 372 "vmsplice": 278, 373 "wait4": 61, 374 "waitid": 247, 375 "write": 1, 376 "writev": 20, 377 } 378 379 var syscallsNumberToName = map[int]string{ 380 156: "_sysctl", 381 43: "accept", 382 288: "accept4", 383 21: "access", 384 163: "acct", 385 248: "add_key", 386 159: "adjtimex", 387 37: "alarm", 388 158: "arch_prctl", 389 49: "bind", 390 321: "bpf", 391 12: "brk", 392 451: "cachestat", 393 125: "capget", 394 126: "capset", 395 80: "chdir", 396 90: "chmod", 397 92: "chown", 398 161: "chroot", 399 305: "clock_adjtime", 400 229: "clock_getres", 401 228: "clock_gettime", 402 230: "clock_nanosleep", 403 227: "clock_settime", 404 56: "clone", 405 435: "clone3", 406 3: "close", 407 436: "close_range", 408 42: "connect", 409 326: "copy_file_range", 410 85: "creat", 411 174: "create_module", 412 176: "delete_module", 413 32: "dup", 414 33: "dup2", 415 292: "dup3", 416 213: "epoll_create", 417 291: "epoll_create1", 418 233: "epoll_ctl", 419 214: "epoll_ctl_old", 420 281: "epoll_pwait", 421 441: "epoll_pwait2", 422 232: "epoll_wait", 423 215: "epoll_wait_old", 424 284: "eventfd", 425 290: "eventfd2", 426 59: "execve", 427 322: "execveat", 428 60: "exit", 429 231: "exit_group", 430 269: "faccessat", 431 439: "faccessat2", 432 221: "fadvise64", 433 285: "fallocate", 434 300: "fanotify_init", 435 301: "fanotify_mark", 436 81: "fchdir", 437 91: "fchmod", 438 268: "fchmodat", 439 93: "fchown", 440 260: "fchownat", 441 72: "fcntl", 442 75: "fdatasync", 443 193: "fgetxattr", 444 313: "finit_module", 445 196: "flistxattr", 446 73: "flock", 447 57: "fork", 448 199: "fremovexattr", 449 431: "fsconfig", 450 190: "fsetxattr", 451 432: "fsmount", 452 430: "fsopen", 453 433: "fspick", 454 5: "fstat", 455 138: "fstatfs", 456 74: "fsync", 457 77: "ftruncate", 458 202: "futex", 459 449: "futex_waitv", 460 261: "futimesat", 461 177: "get_kernel_syms", 462 239: "get_mempolicy", 463 274: "get_robust_list", 464 211: "get_thread_area", 465 309: "getcpu", 466 79: "getcwd", 467 78: "getdents", 468 217: "getdents64", 469 108: "getegid", 470 107: "geteuid", 471 104: "getgid", 472 115: "getgroups", 473 36: "getitimer", 474 52: "getpeername", 475 121: "getpgid", 476 111: "getpgrp", 477 39: "getpid", 478 181: "getpmsg", 479 110: "getppid", 480 140: "getpriority", 481 318: "getrandom", 482 120: "getresgid", 483 118: "getresuid", 484 97: "getrlimit", 485 98: "getrusage", 486 124: "getsid", 487 51: "getsockname", 488 55: "getsockopt", 489 186: "gettid", 490 96: "gettimeofday", 491 102: "getuid", 492 191: "getxattr", 493 175: "init_module", 494 254: "inotify_add_watch", 495 253: "inotify_init", 496 294: "inotify_init1", 497 255: "inotify_rm_watch", 498 210: "io_cancel", 499 207: "io_destroy", 500 208: "io_getevents", 501 333: "io_pgetevents", 502 206: "io_setup", 503 209: "io_submit", 504 426: "io_uring_enter", 505 427: "io_uring_register", 506 425: "io_uring_setup", 507 16: "ioctl", 508 173: "ioperm", 509 172: "iopl", 510 252: "ioprio_get", 511 251: "ioprio_set", 512 312: "kcmp", 513 320: "kexec_file_load", 514 246: "kexec_load", 515 250: "keyctl", 516 62: "kill", 517 445: "landlock_add_rule", 518 444: "landlock_create_ruleset", 519 446: "landlock_restrict_self", 520 94: "lchown", 521 192: "lgetxattr", 522 86: "link", 523 265: "linkat", 524 50: "listen", 525 194: "listxattr", 526 195: "llistxattr", 527 212: "lookup_dcookie", 528 198: "lremovexattr", 529 8: "lseek", 530 189: "lsetxattr", 531 6: "lstat", 532 28: "madvise", 533 237: "mbind", 534 324: "membarrier", 535 319: "memfd_create", 536 447: "memfd_secret", 537 256: "migrate_pages", 538 27: "mincore", 539 83: "mkdir", 540 258: "mkdirat", 541 133: "mknod", 542 259: "mknodat", 543 149: "mlock", 544 325: "mlock2", 545 151: "mlockall", 546 9: "mmap", 547 154: "modify_ldt", 548 165: "mount", 549 442: "mount_setattr", 550 429: "move_mount", 551 279: "move_pages", 552 10: "mprotect", 553 245: "mq_getsetattr", 554 244: "mq_notify", 555 240: "mq_open", 556 243: "mq_timedreceive", 557 242: "mq_timedsend", 558 241: "mq_unlink", 559 25: "mremap", 560 71: "msgctl", 561 68: "msgget", 562 70: "msgrcv", 563 69: "msgsnd", 564 26: "msync", 565 150: "munlock", 566 152: "munlockall", 567 11: "munmap", 568 303: "name_to_handle_at", 569 35: "nanosleep", 570 262: "newfstatat", 571 180: "nfsservctl", 572 2: "open", 573 304: "open_by_handle_at", 574 428: "open_tree", 575 257: "openat", 576 437: "openat2", 577 34: "pause", 578 298: "perf_event_open", 579 135: "personality", 580 438: "pidfd_getfd", 581 434: "pidfd_open", 582 424: "pidfd_send_signal", 583 22: "pipe", 584 293: "pipe2", 585 155: "pivot_root", 586 330: "pkey_alloc", 587 331: "pkey_free", 588 329: "pkey_mprotect", 589 7: "poll", 590 271: "ppoll", 591 157: "prctl", 592 17: "pread64", 593 295: "preadv", 594 327: "preadv2", 595 302: "prlimit64", 596 440: "process_madvise", 597 448: "process_mrelease", 598 310: "process_vm_readv", 599 311: "process_vm_writev", 600 270: "pselect6", 601 101: "ptrace", 602 18: "pwrite64", 603 296: "pwritev", 604 328: "pwritev2", 605 178: "query_module", 606 179: "quotactl", 607 443: "quotactl_fd", 608 0: "read", 609 187: "readahead", 610 89: "readlink", 611 267: "readlinkat", 612 19: "readv", 613 169: "reboot", 614 45: "recvfrom", 615 299: "recvmmsg", 616 47: "recvmsg", 617 216: "remap_file_pages", 618 197: "removexattr", 619 82: "rename", 620 264: "renameat", 621 316: "renameat2", 622 249: "request_key", 623 219: "restart_syscall", 624 84: "rmdir", 625 334: "rseq", 626 13: "rt_sigaction", 627 127: "rt_sigpending", 628 14: "rt_sigprocmask", 629 129: "rt_sigqueueinfo", 630 15: "rt_sigreturn", 631 130: "rt_sigsuspend", 632 128: "rt_sigtimedwait", 633 297: "rt_tgsigqueueinfo", 634 146: "sched_get_priority_max", 635 147: "sched_get_priority_min", 636 204: "sched_getaffinity", 637 315: "sched_getattr", 638 143: "sched_getparam", 639 145: "sched_getscheduler", 640 148: "sched_rr_get_interval", 641 203: "sched_setaffinity", 642 314: "sched_setattr", 643 142: "sched_setparam", 644 144: "sched_setscheduler", 645 24: "sched_yield", 646 317: "seccomp", 647 23: "select", 648 66: "semctl", 649 64: "semget", 650 65: "semop", 651 220: "semtimedop", 652 40: "sendfile", 653 307: "sendmmsg", 654 46: "sendmsg", 655 44: "sendto", 656 238: "set_mempolicy", 657 450: "set_mempolicy_home_node", 658 273: "set_robust_list", 659 205: "set_thread_area", 660 218: "set_tid_address", 661 171: "setdomainname", 662 123: "setfsgid", 663 122: "setfsuid", 664 106: "setgid", 665 116: "setgroups", 666 170: "sethostname", 667 38: "setitimer", 668 308: "setns", 669 109: "setpgid", 670 141: "setpriority", 671 114: "setregid", 672 119: "setresgid", 673 117: "setresuid", 674 113: "setreuid", 675 160: "setrlimit", 676 112: "setsid", 677 54: "setsockopt", 678 164: "settimeofday", 679 105: "setuid", 680 188: "setxattr", 681 30: "shmat", 682 31: "shmctl", 683 67: "shmdt", 684 29: "shmget", 685 48: "shutdown", 686 131: "sigaltstack", 687 282: "signalfd", 688 289: "signalfd4", 689 41: "socket", 690 53: "socketpair", 691 275: "splice", 692 4: "stat", 693 137: "statfs", 694 332: "statx", 695 168: "swapoff", 696 167: "swapon", 697 88: "symlink", 698 266: "symlinkat", 699 162: "sync", 700 277: "sync_file_range", 701 306: "syncfs", 702 139: "sysfs", 703 99: "sysinfo", 704 103: "syslog", 705 276: "tee", 706 234: "tgkill", 707 201: "time", 708 222: "timer_create", 709 226: "timer_delete", 710 225: "timer_getoverrun", 711 224: "timer_gettime", 712 223: "timer_settime", 713 283: "timerfd_create", 714 287: "timerfd_gettime", 715 286: "timerfd_settime", 716 100: "times", 717 200: "tkill", 718 76: "truncate", 719 95: "umask", 720 166: "umount2", 721 63: "uname", 722 87: "unlink", 723 263: "unlinkat", 724 272: "unshare", 725 134: "uselib", 726 323: "userfaultfd", 727 136: "ustat", 728 132: "utime", 729 280: "utimensat", 730 235: "utimes", 731 58: "vfork", 732 153: "vhangup", 733 278: "vmsplice", 734 61: "wait4", 735 247: "waitid", 736 1: "write", 737 20: "writev", 738 }