SlideShare a Scribd company logo
AbemaTV
Linux / x86 Go
AbemaTV
Masashi SHIBATA
c-bata c_bata_! "
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello World! %d %sn", argc, argv[0]);
return 0;
}
strace
$ gcc hello.c -o hello -Wall -O0
$ strace ./hello
hello.c
$ strace ./hello
execve("./hello", ["./hello"], [/* 25 vars */]) = 0
uname({sys="Linux", node="ip-10-0-2-15.ap-
northeast-1.compute.internal", ...}) = 0
:
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=ma…
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, …
write(1, "Hello World! 1 ./hellon",

23Hello World! 1 ./hello) = 23
exit_group(0) = ?
strace
$ strace ./hello
execve("./hello", ["./hello"], [/* 25 vars */]) = 0
uname({sys="Linux", node="ip-10-0-2-15.ap-
northeast-1.compute.internal", ...}) = 0
:
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=ma…
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, …
write(1, "Hello World! 1 ./hellon",

23Hello World! 1 ./hello) = 23
exit_group(0) = ?
fork execve
$ strace ./hello
execve("./hello", ["./hello"], [/* 25 vars */]) = 0
uname({sys="Linux", node="ip-10-0-2-15.ap-
northeast-1.compute.internal", ...}) = 0
:
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=ma…
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, …
write(1, "Hello World! 1 ./hellon",

23Hello World! 1 ./hello) = 23
exit_group(0) = ?
write
Topic 1
Linux / X86 CPU
Application Binary Interface
System Call Numbers
X86 Registers
KEYWORDS
ABI: Application Binary Interface
システムコールトレーサーの動作原理と実装 (Writing system call tracer for Linux/x86)
システムコールトレーサーの動作原理と実装 (Writing system call tracer for Linux/x86)
https://github.com/torvalds/linux/blob/v4.14/arch/x86/entry/syscalls/syscall_32.tbl
0 i386 restart_syscall sys_restart_syscall
1 i386 exit sys_exit
2 i386 fork sys_fork sys_fork
3 i386 read sys_read
4 i386 write sys_write
5 i386 open sys_open compat_sys_open


Topic 2
ptrace
ptrace system call
https://github.com/c-bata/systrace/
KEYWORDS
ptrace
ptrace system call
https://github.com/c-bata/systracer
Target(Traced) ProcessTracing Process
ptrace(PTRACE_TRACEME, …)
waitpid(pid, &status, 0)
if WIFEXITED(status) { break; }
ptrace(PTRACE_GETREGS, …)
ptrace(PTRACE_SYSCALL, …)
execve(…)
fork()
while(1)
SIGCONT
!
!
!
!
!
https://github.com/c-bata/systrace/
システムコールトレーサーの動作原理と実装 (Writing system call tracer for Linux/x86)

More Related Content

PDF
プログラム実行の話と
OSとメモリの挙動の話
TXT
Yg byev2e
PDF
Intro to Systems Orchestration with MCollective
DOCX
Chat code
PDF
ES6 - Level up your JavaScript Skills
TXT
Network
PDF
Haskell Packageのdeb化
PDF
rush, the Ruby shell and Unix integration library
プログラム実行の話と
OSとメモリの挙動の話
Yg byev2e
Intro to Systems Orchestration with MCollective
Chat code
ES6 - Level up your JavaScript Skills
Network
Haskell Packageのdeb化
rush, the Ruby shell and Unix integration library

What's hot (20)

PDF
Hacking Mac OSX Cocoa API from Perl
PDF
PDF
GLX, DRI, and i965
PDF
ES6 generators
PDF
Javascript ES6 generators
PDF
ng-conf 2017: Angular Mischief Maker Slides
PDF
20151224-games
PDF
R-House (LSRC)
PDF
2016 gunma.web games-and-asm.js
PPTX
Azure Durable Funkiness - .NET Oxford June 2018
PPTX
A Brief Introduction to Writing and Understanding Puppet Modules
PDF
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
PDF
completion_proc and history
PDF
FLiSOL - Oficina Ruby on Rails
KEY
Clojure入門
TXT
Xstartup
PPTX
Creating beautiful puppet modules with puppet-lint
TXT
Mamamia
PDF
JavaSE7 Launch Event: Java7xGroovy
PDF
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Hacking Mac OSX Cocoa API from Perl
GLX, DRI, and i965
ES6 generators
Javascript ES6 generators
ng-conf 2017: Angular Mischief Maker Slides
20151224-games
R-House (LSRC)
2016 gunma.web games-and-asm.js
Azure Durable Funkiness - .NET Oxford June 2018
A Brief Introduction to Writing and Understanding Puppet Modules
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...
completion_proc and history
FLiSOL - Oficina Ruby on Rails
Clojure入門
Xstartup
Creating beautiful puppet modules with puppet-lint
Mamamia
JavaSE7 Launch Event: Java7xGroovy
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Ad

Similar to システムコールトレーサーの動作原理と実装 (Writing system call tracer for Linux/x86) (20)

PDF
Linux seccomp(2) vs OpenBSD pledge(2)
PDF
Basicsof c make and git for a hello qt application
DOCX
Assignment no39
ODP
C Under Linux
PDF
Shrink to grow
PDF
start_printf: dev/ic/com.c comstart()
PDF
ZeroMQ: Messaging Made Simple
PDF
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
PDF
Gaztea Tech Robotica 2016
PDF
What Have Syscalls Done for you Lately?
PPTX
Naughty And Nice Bash Features
PDF
SICP勉強会について
PPTX
ISCA Final Presentaiton - Compilations
PDF
Libtcc and gwan
PDF
Libtcc and gwan
PDF
Marat-Slides
PDF
망고100 보드로 놀아보자 15
PDF
Shellcoding in linux
Linux seccomp(2) vs OpenBSD pledge(2)
Basicsof c make and git for a hello qt application
Assignment no39
C Under Linux
Shrink to grow
start_printf: dev/ic/com.c comstart()
ZeroMQ: Messaging Made Simple
printf("%s from %c to Z, in %d minutes!\n", "printf", 'A', 45);
Gaztea Tech Robotica 2016
What Have Syscalls Done for you Lately?
Naughty And Nice Bash Features
SICP勉強会について
ISCA Final Presentaiton - Compilations
Libtcc and gwan
Libtcc and gwan
Marat-Slides
망고100 보드로 놀아보자 15
Shellcoding in linux
Ad

More from Masashi Shibata (20)

PDF
MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
PDF
実践Djangoの読み方 - みんなのPython勉強会 #72
PDF
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1
PDF
サイバーエージェントにおけるMLOpsに関する取り組み at PyDataTokyo 23
PDF
Implementing sobol's quasirandom sequence generator
PDF
DARTS: Differentiable Architecture Search at 社内論文読み会
PDF
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
PDF
PythonとAutoML at PyConJP 2019
PDF
Djangoアプリのデプロイに関するプラクティス / Deploy django application
PDF
Django REST Framework における API 実装プラクティス | PyCon JP 2018
PDF
Django の認証処理実装パターン / Django Authentication Patterns
PDF
RTMPのはなし - RTMP1.0の仕様とコンセプト / Concepts and Specification of RTMP
PDF
Golangにおける端末制御 リッチなターミナルUIの実現方法
PDF
How to develop a rich terminal UI application
PDF
Introduction of Feedy
PDF
Webフレームワークを作ってる話 #osakapy
PDF
Pythonのすすめ
PDF
pandasによるデータ加工時の注意点やライブラリの話
PDF
Pythonistaのためのデータ分析入門 - C4K Meetup #3
PDF
テスト駆動開発入門 - C4K Meetup#2
MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
実践Djangoの読み方 - みんなのPython勉強会 #72
CMA-ESサンプラーによるハイパーパラメータ最適化 at Optuna Meetup #1
サイバーエージェントにおけるMLOpsに関する取り組み at PyDataTokyo 23
Implementing sobol's quasirandom sequence generator
DARTS: Differentiable Architecture Search at 社内論文読み会
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
PythonとAutoML at PyConJP 2019
Djangoアプリのデプロイに関するプラクティス / Deploy django application
Django REST Framework における API 実装プラクティス | PyCon JP 2018
Django の認証処理実装パターン / Django Authentication Patterns
RTMPのはなし - RTMP1.0の仕様とコンセプト / Concepts and Specification of RTMP
Golangにおける端末制御 リッチなターミナルUIの実現方法
How to develop a rich terminal UI application
Introduction of Feedy
Webフレームワークを作ってる話 #osakapy
Pythonのすすめ
pandasによるデータ加工時の注意点やライブラリの話
Pythonistaのためのデータ分析入門 - C4K Meetup #3
テスト駆動開発入門 - C4K Meetup#2

Recently uploaded (20)

PPTX
Introduction to Information and Communication Technology
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PPTX
artificial intelligence overview of it and more
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPT
tcp ip networks nd ip layering assotred slides
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
Digital Literacy And Online Safety on internet
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Testing WebRTC applications at scale.pdf
Introduction to Information and Communication Technology
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Introuction about ICD -10 and ICD-11 PPT.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
introduction about ICD -10 & ICD-11 ppt.pptx
Slides PDF The World Game (s) Eco Economic Epochs.pdf
artificial intelligence overview of it and more
522797556-Unit-2-Temperature-measurement-1-1.pptx
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
The New Creative Director: How AI Tools for Social Media Content Creation Are...
tcp ip networks nd ip layering assotred slides
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Digital Literacy And Online Safety on internet
Job_Card_System_Styled_lorem_ipsum_.pptx
Slides PPTX World Game (s) Eco Economic Epochs.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Testing WebRTC applications at scale.pdf

システムコールトレーサーの動作原理と実装 (Writing system call tracer for Linux/x86)