uftrace: function graph tracer for C/C++
|
|
- Bryce Newton
- 6 years ago
- Views:
Transcription
1 uftrace: function graph tracer for C/C++ Namhyung Kim ( 김남형 ) namhyung@gmail.com namhyung.kim@lge.com Open Source Summit "Powered by Marp"
2 uftrace overview function tracer for C/C++ inspired by ftrace framework in the kernel analyze single process execution tracing library calls and kernel various ltering and features project homepage "Open Source Summit 2017" 2
3 Installation requirements OS: Linux Arch: x86_64, ARM(v6+), AArch64 Library: libelf (elfutils) Distro packaging Debian/Ubuntu: OK Fedora: WIP Archlinux: AUR OpenEmbedded: OK $ make $ sudo make install "Open Source Summit 2017" 3
4 Before running compiler support need to rebuild your program (ouch!) use -pg (or -finstrument-functions ) add calls to mcount for every function recent compilers provide advanced options $ gcc -pg <program> or $ gcc -finstrument-functions <program> "Open Source Summit 2017" 4
5 Running uftrace run your program with uftrace uftrace does fork+exec for you save tracing data to shmem and then les analyze the data $ uftrace <command> <program> "Open Source Summit 2017" 5
6 uftrace commands recording record, recv, live analysis misc replay, report, graph, script info, dump "Open Source Summit 2017" 6
7 uftrace live default command can be omitted (does record + replay) $ uftrace hello Hello World us [22715] monstartup(); us [22715] cxa_atexit(); [22715] main() { us [22715] printf(); us [22715] } /* main */ "Open Source Summit 2017" 7
8 uftrace record program execution fork + exec to run your program child process LD_PRELOAD=libmcount.so controlled by environment variables saves trace data into shmem communicates to uftrace via pipe uftrace create directory to save data (uftrace.data) write data in shmem to les additional information for system/process "Open Source Summit 2017" 8
9 uftrace replay show process execution timeline $ uftrace replay -f +time -d abc.data # DURATION TID TIMESTAMP FUNCTION [ 1892] main() { [ 1892] a() { [ 1892] b() { [ 1892] c() { us [ 1892] getpid() us [ 1892] } /* c */ us [ 1892] } /* b */ us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 9
10 uftrace replay "Open Source Summit 2017" 10
11 uftrace report show table of process runtime $ uftrace report -s self Total time Self time Calls Function ========== ========== ===== ========= us us 1 c us us 1 getpid us us 1 b us us 1 main us us 1 a "Open Source Summit 2017" 11
12 uftrace report --diff "Open Source Summit 2017" 12
13 uftrace graph show function call graph $ uftrace graph a... backtrace ===================================== backtrace #0: hit 1, time us [0] main (0x400512) [1] a (0x4006b2) calling functions ===================================== us : (1) a us : (1) b us : (1) c us : (1) getpid "Open Source Summit 2017" 13
14 uftrace graph "Open Source Summit 2017" 14
15 uftrace script run (python) script for each function $ cat count.py count = 0 def uftrace_begin(): pass def uftrace_entry(ctx): global count count += 1 def uftrace_exit(ctx): pass def uftrace_end(): print(count) $ uftrace script -S count.py 5 "Open Source Summit 2017" 15
16 uftrace script supported language python (2.7) context info addr, name, timestamp, tid, depth duration (exit), args (entry), retval (exit) options function lter: UFTRACE_FUNCS = [ "func1",... ] record option: # uftrace-option:... "Open Source Summit 2017" 16
17 uftrace dump dump le contents and convert format $ uftrace dump uftrace file header: magic = uftrace file header: version = 4 uftrace file header: header size = 40 uftrace file header: endian = 1 (little) uftrace file header: class = 2 (64 bit) uftrace file header: features = 0x63 (PLTHOOK...) uftrace file header: info = 0x3ff : [entry] main(400512) depth: : [entry] a(4006b2) depth: : [entry] b(4006a0) depth: : [entry] c(400686) depth: : [entry] getpid(4004b0) depth: 4... "Open Source Summit 2017" 17
18 uftrace info (1/2) show system information $ uftrace info # system information # ================== # program version : uftrace v0.8 # recorded on : Sun Jul 30 23:37: # cmdline : uftrace record abc # cpu info : Intel(R) Core(TM) i7-2640m CPU... # number of cpus : 4 / 4 (online / possible) # memory info : 11.3 / 15.5 GB (free / total) # system load : 0.44 / 0.34 / 0.29 (1 / 5 / 15 min) # kernel version : Linux ARCH # hostname : danjae # distro : "Arch Linux"... "Open Source Summit 2017" 18
19 uftrace info (2/2) and process information... # process information # =================== # number of tasks : 1 # task list : 1892 # exe image : /home/namhyung/tmp/uftrace/abc # build id : 5ba a40118e047353e7994fc... # exit status : exited with code: 0 # elapsed time : sec # cpu time : / sec (sys / user) # context switch : 1 / 1 (voluntary / involuntary) # max rss : 3252 KB # page fault : 0 / 189 (major / minor) # disk iops : 0 / 16 (read / write) "Open Source Summit 2017" 19
20 uftrace recv save data through network record command can send -H/--host option default port: 8090 useful for embedded systems lacks disk space $ uftrace recv --port 8090 $ uftrace record -H <server> "Open Source Summit 2017" 20
21 uftrace tips using lters lters, triggers, dynamic patch accessing arguments argument/return value speci cation corelate kernel execution Linux kernel function graph tracer event tracing SDT, kernel tracepoint, read-trigger, scheduler data visualization Chrome tracing, ame graph "Open Source Summit 2017" 21
22 Using function lters lter (inclusive) $ uftrace -F a abc [ 1892] a() { [ 1892] b() { [ 1892] c() { us [ 1892] getpid() us [ 1892] } /* c */ us [ 1892] } /* b */ us [ 1892] } /* a */ "Open Source Summit 2017" 22
23 Using function lters lter (exclusive) $ uftrace replay -N c [ 1892] main() { [ 1892] a() { us [ 1892] b(); us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 23
24 Using function lters lter (regex) $ uftrace -N ^get abc [ 1892] main() { [ 1892] a() { [ 1892] b() { us [ 1892] c(); us [ 1892] } /* b */ us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 24
25 Using depth lters lter $ uftrace -D 3 abc [ 1892] main() { [ 1892] a() { us [ 1892] b(); us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 25
26 Using lters time lter $ uftrace -t 3us abc [ 1892] main() { [ 1892] a() { [ 1892] b() { us [ 1892] c(); us [ 1892] } /* b */ us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 26
27 Using lters lter combinations $ uftrace -F main -D 3 -t 3us abc [ 1892] main() { [ 1892] a() { us [ 1892] b(); us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 27
28 Using lters task lter (not avaiable for record) $ uftrace replay --tid 1892 [ 1892] main() { [ 1892] a() { [ 1892] b() { [ 1892] c() { us [ 1892] getpid() us [ 1892] } /* c */ us [ 1892] } /* b */ us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 28
29 Using triggers trigger allows to override settings for each function depth trigger $ uftrace -T a@depth=1 abc [ 1892] main() { us [ 1892] a(); us [ 1892] } /* main */ "Open Source Summit 2017" 29
30 Using triggers time trigger $ uftrace -T b@time=4us abc [ 1892] main() { [ 1892] a() { us [ 1892] b(); us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 30
31 Using triggers trace-off trigger $ uftrace -T getpid@trace-off abc [ 1892] main() { [ 1892] a() { [ 1892] b() { [ 1892] c() { uftrace stopped tracing with remaining functions ================================================ task: 1892 [3] c [2] b [1] a [0] main "Open Source Summit 2017" 31
32 Using triggers trace-on trigger (used with --disable) $ uftrace --disable -T b@trace-on abc [ 1892] b() { [ 1892] c() { us [ 1892] getpid() us [ 1892] } /* c */ us [ 1892] } /* b */ us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 32
33 Using triggers color trigger (replay only) $ uftrace -T getpid@color=red abc [ 1892] main() { [ 1892] a() { [ 1892] b() { [ 1892] c() { us [ 1892] getpid() us [ 1892] } /* c */ us [ 1892] } /* b */ us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 33
34 Using triggers read trigger (record only) $ uftrace -T a@read=proc/statm abc [ 1892] main() { [ 1892] a() { [ 1892] /* read:proc/statm (size=100k,...) */ [ 1892] b() { [ 1892] c() { us [ 1892] getpid() us [ 1892] } /* c */ us [ 1892] } /* b */ us [ 1892] } /* a */ us [ 1892] } /* main */ "Open Source Summit 2017" 34
35 Accessing arguments basic usage $ uftrace -A printf@arg1 hello Hello World us [22715] monstartup(); us [22715] cxa_atexit(); [22715] main() { us [22715] printf(0x400746); us [22715] } /* main */ "Open Source Summit 2017" 35
36 Accessing arguments argument format $ uftrace -A printf@arg1/s hello Hello World us [22715] monstartup(); us [22715] cxa_atexit(); [22715] main() { us [22715] printf("hello %s\n"); us [22715] } /* main */ "Open Source Summit 2017" 36
37 Accessing arguments return value $ uftrace -R printf@retval hello Hello World us [22715] monstartup(); us [22715] cxa_atexit(); [22715] main() { us [22715] printf() = 12; us [22715] } /* main */ "Open Source Summit 2017" 37
38 Kernel tracing basic usage $ sudo uftrace -k hello Hello World us [22715] monstartup(); us [22715] cxa_atexit(); [22715] main() { [22715] printf() { us [22715] sys_newfstat(); us [22715] do_page_fault(); us [22715] } /* printf */ us [22715] } /* main */ "Open Source Summit 2017" 38
39 Kernel tracing function lter $ sudo uftrace -k -F do_page_fault@kernel hello Hello World us [22715] monstartup(); us [22715] cxa_atexit(); [22715] main() { [22715] printf() { us [22715] do_page_fault(); us [22715] } /* printf */ us [22715] } /* main */ "Open Source Summit 2017" 39
40 Kernel tracing depth lter $ sudo uftrace -F main -K 2 hello Hello World [28473] main() { [28473] printf() { [28473] sys_newfstat() { us [28473] vfs_statx_fd(); us [28473] cp_new_stat(); us [28473] } /* sys_newfstat */ [28473] do_page_fault() { us [28473] down_read_trylock(); us [28473] find_vma(); us [28473] handle_mm_fault(); us [28473] up_read(); us [28473] } /* do_page_fault */ us [28473] } /* printf */ us [28473] } /* main */ "Open Source Summit 2017" 40
41 Library call tracing by hooking PLT (no need to rebuild) $ uftrace --force /usr/bin/pwd /home/namhyung/tmp/uftrace/tutorial us [22715] cxa_atexit(); us [22715] getopt_long(); us [22715] getcwd(); us [22715] puts(); us [22715] free();... "Open Source Summit 2017" 41
42 Library call tracing accessing argument $ uftrace --force -R getcwd@retval/s /usr/bin/pwd /home/namhyung/tmp/uftrace/tutorial us [22715] cxa_atexit(); us [22715] getopt_long(); us [22715] getcwd() = "/home/namhyung/tmp/uftrace/tutoria us [22715] puts(); us [22715] free();... "Open Source Summit 2017" 42
43 Library call tracing tracing nested library calls $ uftrace --force --nest-libcall -t 1us /usr/bin/ps PID TTY TIME CMD 1761 pts/3 00:00:05 bash 6633 pts/3 00:00:00 uftrace 6634 pts/3 00:00:00 less 6635 pts/3 00:00:00 ps us [ 6635] setlocale(); us [ 6635] bindtextdomain(); [ 6635] look_up_our_self() { us [ 6635] sprintf_chk(); us [ 6635] open(); us [ 6635] read(); us [ 6635] close(); us [ 6635] sscanf(); us [ 6635] } /* look_up_our_self */... "Open Source Summit 2017" 43
44 Library call tracing not tracing library calls $ uftrace --no-libcall hello Hello World us [22715] main(); "Open Source Summit 2017" 44
45 Dynamic tracing need (recent) compiler support add a nop-sled when compile convert it to jump at runtime (load-time precisely) gcc has -mnop-mcount $ gcc -pg -mfentry -mnop-mcount -o abc abc.c clang has -fxray-instrument $ clang -fxray-instrument -fxray-instruction-threshold=1 abc.c "Open Source Summit 2017" 45
46 Dynamic tracing $ uftrace abc uftrace: /home/namhyung/project/uftrace/cmd-record.c:1449:check_bin ERROR: Can't find 'mcount' symbol in the 'abc'. It seems not to be compiled with -pg or -finstrument-functi which generates traceable code. Please check your binary fi $ uftrace -P b --no-libcall abc us [ 1890] b(); $ uftrace -P b abc [ 1892] b() { us [ 1892] getpid() us [ 1892] } /* b */ "Open Source Summit 2017" 46
47 Visualization Chrome tracing tool uftrace record + dump run Chrome browser open chrome://tracing load the JSON data le $ uftrace record <program> $ uftrace dump --chrome > abc.json "Open Source Summit 2017" 47
48 Visualization "Open Source Summit 2017" 48
49 Visualization Flame graph uftrace record + dump convert to Flame graph format (SVG) open in a Web browser $ uftrace record <program> $ uftrace dump --flame-graph flamegraph.pl > abc.svg $ firefox abc.svg "Open Source Summit 2017" 49
50 Visualization "Open Source Summit 2017" 50
51 Event tracing built-in event read trigger (proc/statm, page-fault) scheduler event using PERF_RECORD_SWITCH (v4.3+) user event systemtap SDT v3, x86_64 only (for now) kernel event tracepoint + libtraceevent "Open Source Summit 2017" 51
52 Event tracing scheduler event $ uftrace --force -t 1ms -E linux:schedule /usr/bin/sleep 0.1 [15755] nanosleep() { ms [15755] /* linux:schedule */ ms [15755] } /* nanosleep */ kernel event $ sudo uftrace --force -t 1ms -E sched_switch@kernel /usr/bin/sleep [17937] nanosleep() { [17937] /* sched:sched_switch (prev_comm=sleep...) [17937] /* sched:sched_switch (prev_comm=swapper/ ms [17937] } /* nanosleep */ "Open Source Summit 2017" 52
53 Future works debug info (DWARF) automatic access to arguments and return value user interface make it easier to use script enhancement more useful scripts dynamic tracing without compiler support performance improvement "Open Source Summit 2017" 53
54 Thanks uftrace homepage tutorial chat "Open Source Summit 2017" 54
uftrace: A function graph tracer for C/C++ userspace programs
uftrace: A function graph tracer for C/C++ userspace programs Lightning Talk at CppCon 2016 September 23, 2016 Namhyung Kim, Honggyu Kim LG Electronics {namhyung.kim, hong.gyu.kim@lge.com uftrace https://github.com/namhyung/uftrace
More informationHere hands-on tutorials with. Taeung Song 송태웅, KOSSLAB
Goodbye Talk Title! printf() Here hands-on tutorials with uftrace: Author Name,function Company graph tracer for C/C++ Taeung Song 송태웅, KOSSLAB Why use printf()? during development As you know.. Program
More informationHigh Performance Computing Lecture 11. Matthew Jacob Indian Institute of Science
High Performance Computing Lecture 11 Matthew Jacob Indian Institute of Science Agenda 1. Program execution: Compilation, Object files, Function call and return, Address space, Data & its representation
More informationSystem Wide Tracing User Need
System Wide Tracing User Need dominique toupin ericsson com April 2010 About me Developer Tool Manager at Ericsson, helping Ericsson sites to develop better software efficiently Background
More informationRALPH BÖHME, SERNET, SAMBA TEAM UNDERSTANDING AND IMPROVING SAMBA FILESERVER PERFORMANCE HOW I FELL IN LOVE WITH SYSTEMTAP AND PERF
UNDERSTANDING AND IMPROVING HOW I FELL IN LOVE WITH SYSTEMTAP AND PERF 2 AGENDA Disclaimer: focus on userspace, not kernel, mostly Linux Linux tracing history tour de force perf Systemtap Samba fileserver
More informationPROCESSES. Jo, Heeseung
PROCESSES Jo, Heeseung TODAY'S TOPICS What is the process? How to implement processes? Inter-Process Communication (IPC) 2 WHAT IS THE PROCESS? Program? vs. Process? vs. Processor? 3 PROCESS CONCEPT (1)
More informationProcesses. Jo, Heeseung
Processes Jo, Heeseung Today's Topics What is the process? How to implement processes? Inter-Process Communication (IPC) 2 What Is The Process? Program? vs. Process? vs. Processor? 3 Process Concept (1)
More informationFtrace Kernel Hooks: More than just tracing. Presenter: Steven Rostedt Red Hat
Ftrace Kernel Hooks: More than just tracing Presenter: Steven Rostedt rostedt@goodmis.org Red Hat Ftrace Function Hooks Function Tracer Function Graph Tracer Function Profiler Stack Tracer Kprobes Uprobes
More informationSource level debugging. October 18, 2016
Source level debugging October 18, 2016 Source level debugging Source debugging is a nice tool for debugging execution problems; it can be particularly useful when working with crashed programs that leave
More informationGDB Tutorial. Young W. Lim Tue. Young W. Lim GDB Tutorial Tue 1 / 32
GDB Tutorial Young W. Lim 2017-02-14 Tue Young W. Lim GDB Tutorial 2017-02-14 Tue 1 / 32 Outline 1 Introduction Young W. Lim GDB Tutorial 2017-02-14 Tue 2 / 32 Based on "Self-service Linux: Mastering the
More informationFall 2015 COMP Operating Systems. Lab #3
Fall 2015 COMP 3511 Operating Systems Lab #3 Outline n Operating System Debugging, Generation and System Boot n Review Questions n Process Control n UNIX fork() and Examples on fork() n exec family: execute
More informationGDB Tutorial. Young W. Lim Fri. Young W. Lim GDB Tutorial Fri 1 / 24
GDB Tutorial Young W. Lim 2016-02-19 Fri Young W. Lim GDB Tutorial 2016-02-19 Fri 1 / 24 Outline 1 Introduction Young W. Lim GDB Tutorial 2016-02-19 Fri 2 / 24 Based on Self-service Linux: Mastering the
More informationGDB Tutorial. Young W. Lim Thr. Young W. Lim GDB Tutorial Thr 1 / 24
GDB Tutorial Young W. Lim 2016-09-29 Thr Young W. Lim GDB Tutorial 2016-09-29 Thr 1 / 24 Outline 1 Introduction Young W. Lim GDB Tutorial 2016-09-29 Thr 2 / 24 Based on "Self-service Linux: Mastering the
More informationProcesses. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University
Processes Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu OS Internals User space shell ls trap shell ps Kernel space File System Management I/O
More informationImproving Linux development with better tools
Improving Linux development with better tools Andi Kleen Oct 2013 Intel Corporation ak@linux.intel.com Linux complexity growing Source lines in Linux kernel All source code 16.5 16 15.5 M-LOC 15 14.5 14
More informationTracing Lustre. New approach to debugging. ORNL is managed by UT-Battelle for the US Department of Energy
Tracing Lustre New approach to debugging ORNL is managed by UT-Battelle for the US Department of Energy Current Lustre debugging tools Utility lctl handles profiling developed long before standard kernel
More informationProject #1: Tracing, System Calls, and Processes
Project #1: Tracing, System Calls, and Processes Objectives In this project, you will learn about system calls, process control and several different techniques for tracing and instrumenting process behaviors.
More informationIntroduction to Linux
Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Dong-Yun Lee (dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating
More informationSystemTap Tutorial - Part 1
Logo ref: http://sourceware.org/systemtap/wiki/lw2008systemtaptutorial SystemTap Tutorial - Part 1 Who is doing maximum read/write on my server? Can I add some debug statements in the kernel without rebuilding,
More informationUnix Processes. What is a Process?
Unix Processes Process -- program in execution shell spawns a process for each command and terminates it when the command completes Many processes all multiplexed to a single processor (or a small number
More informationImproving Linux Development with better tools. Andi Kleen. Oct 2013 Intel Corporation
Improving Linux Development with better tools Andi Kleen Oct 2013 Intel Corporation ak@linux.intel.com Linux complexity growing Source lines in Linux kernel All source code 16.5 16 15.5 M-LOC 15 14.5 14
More informationMaking Dynamic Instrumentation Great Again
Making Dynamic Instrumentation Great Again Malware Research Team @ @xabiugarte [advertising space ] Deep Packer Inspector https://packerinspector.github.io https://packerinspector.com Many instrumentation
More informationIntroduction to Linux
Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Kisik Jeong (kisik@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating
More informationEECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou
EECS 2031 - Software Tools Lab 2 Tutorial: Introduction to UNIX/Linux Tilemachos Pechlivanoglou (tipech@eecs.yorku.ca) Sep 22 & 25, 2017 Material marked with will be in your exams Sep 22 & 25, 2017 Introduction
More informationSystemtap times April 2009
Systemtap times April 2009 Frank Ch. Eigler systemtap lead why trace/probe to monitor future background monitoring, flight recording programmed response to debug present symbolic, source-level
More informationThe Unix Shell & Shell Scripts
The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises
More informationSection 1: Tools. Contents CS162. January 19, Make More details about Make Git Commands to know... 3
CS162 January 19, 2017 Contents 1 Make 2 1.1 More details about Make.................................... 2 2 Git 3 2.1 Commands to know....................................... 3 3 GDB: The GNU Debugger
More informationsyscall_intercept A user space library for intercepting system calls Author Name, Company Krzysztof Czuryło, Intel
Talk syscall_intercept Title Here A user space library for intercepting system calls Author Name, Company Krzysztof Czuryło, Intel What it is? Provides a low-level interface for hooking Linux system calls
More informationSystemTap update & overview. Josh Stone Software Engineer, Red Hat
SystemTap update & overview Josh Stone Software Engineer, Red Hat Introduction SystemTap: a tool for system-wide instrumentation Inspired by Sun DTrace, IBM dprobes, etc. GPL license,
More informationPROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo
PROCESS MANAGEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication
More informationExceptional Control Flow Part I Oct. 17, 2002
15-213 The course that gives CMU its Zip! Exceptional Control Flow Part I Oct. 17, 2002 Topics Exceptions Process context switches Creating and destroying processes class16.ppt Control Flow Computers do
More informationControl Flow. Systemprogrammering 2007 Föreläsning 2 Exceptional Control Flow Part I. Exceptional Control Flow. Altering the Control Flow
Systemprogrammering 2007 Föreläsning 2 Exceptional Control Flow Part I Topics Exceptions Process context switches Creating and destroying processes Control Flow Computers do Only One Thing From startup
More informationAltering the Control Flow
Altering the Control Flow Up to Now: two mechanisms for changing control flow: Jumps and branches Call and return using the stack discipline. Both react to changes in program state. Insufficient for a
More informationCS240: Programming in C
CS240: Programming in C Lecture 16: Process and Signals Cristina Nita-Rotaru Lecture 16/ Fall 2013 1 Processes in UNIX UNIX identifies processes via a unique Process ID Each process also knows its parent
More informationGiving credit where credit is due
CSCE 230J Computer Organization Exceptional Control Flow Part I Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due Most of slides for this
More informationEXPERIMENT NO : M/C Lenovo Think center M700 Ci3,6100,6th Gen. H81, 4GB RAM,500GB HDD
GROUP - C EXPERIMENT NO : 12 1. Title: Implement UNIX system calls like ps, fork, join, exec family, and wait for process management (use shell script/ Java/ C programming) 2. Objectives : - To understand
More informationSOFTWARE ARCHITECTURE 3. SHELL
1 SOFTWARE ARCHITECTURE 3. SHELL Tatsuya Hagino hagino@sfc.keio.ac.jp slides URL https://vu5.sfc.keio.ac.jp/sa/login.php 2 Software Layer Application Shell Library MIddleware Shell Operating System Hardware
More informationSE350: Operating Systems
SE350: Operating Systems Tutorial: The Programming Interface Main Points Creating and managing processes fork, exec, wait Example: implementing a shell Shell A shell is a job control system Allows programmer
More informationUser Space Tracing in Small Footprint Devices. (How Low can You Go?)
User Space Tracing in Small Footprint Devices (How Low can You Go?) Jason Wessel - Product Architect for WR Linux Core Runtime - Kernel.org KDB/KGDB Maintainer August 18 th, 2011 Agenda What is UST? How
More informationECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017
ECE 550D Fundamentals of Computer Systems and Engineering Fall 2017 The Operating System (OS) Prof. John Board Duke University Slides are derived from work by Profs. Tyler Bletsch and Andrew Hilton (Duke)
More informationCollect Linux Hardware Trace for ARMv8 User Space and Kernel Space Applications
NXP Semiconductors Document Number: AN5129 Application Note Rev. 11.3.0, 12/2017 Collect Linux Hardware Trace for ARMv8 User Space and Kernel Space Applications 1 Introduction This document describes the
More information21. This is a screenshot of the Android Studio Debugger. It shows the current thread and the object tree for a certain variable.
4. Logging is an important part of debugging, which is hard to achieve on mobile devices, where application development and execution take place on different systems. Android includes a framework that
More informationWindows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.
Structure Unix architecture users Functions of the System tools (shell, editors, compilers, ) standard library System call Standard library (printf, fork, ) OS kernel: processes, memory management, file
More informationSystem Programming. Introduction to Unix
Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introduction 2 3 Introduction
More informationIntroduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University
Introduction to Linux Woo-Yeong Jeong (wooyeong@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating system of a computer What is an
More informationAltering the Control Flow
Altering the Control Flow Up to Now: two mechanisms for changing control flow: Jumps and branches Call and return using the stack discipline. Both react to changes in program state. Insufficient for a
More informationExceptional Control Flow Part I September 22, 2008
15-213 Exceptional Control Flow Part I September 22, 2008 Topics Exceptions Process context switches Creating and destroying processes class11.ppt Control Flow Computers do only one thing: From startup
More informationDTrace for Linux. Tomas Jedlicka Sat
DTrace for Linux Tomas Jedlicka 2018-02-03 Sat Introduction Overview DTrace has been released in 2005 for Sun s Solaris operating system. Today it has become adopted by other
More informationCode Instrumentation, Dynamic Tracing
Code Instrumentation, Dynamic Tracing http://d3s.mff.cuni.cz/aosy http://d3s.mff.cuni.cz Martin Děcký decky@d3s.mff.cuni.cz Observability What is the system doing? Beyond the obvious (externally visible
More informationExceptional Control Flow Part I
Exceptional Control Flow Part I Today Exceptions Process context switches Creating and destroying processes Next time Signals, non-local jumps, Chris Riesbeck, Fall 2011 Original: Fabian Bustamante Control
More informationCrate Shell. Release
Crate Shell Release Jul 10, 2017 Contents 1 Installation & Usage 3 1.1 Limitations................................................ 5 2 Command Line Arguments 7 2.1 Example Usage..............................................
More informationIntroduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras
Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Week 03 Lecture 12 Create, Execute, and Exit from a Process
More informationOverhead Evaluation about Kprobes and Djprobe (Direct Jump Probe)
Overhead Evaluation about Kprobes and Djprobe (Direct Jump Probe) Masami Hiramatsu Hitachi, Ltd., SDL Jul. 13. 25 1. Abstract To implement flight recorder system, the overhead
More informationProcess Control. Philipp Koehn. 23 April 2018
Process Control Philipp Koehn 23 April 2018 Control Flow 1 The CPU executes one instruction after another Typically, they are next to each other in memory (unless jumps, branches, and returns from subroutine)
More informationCS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 20
CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 2018 Lecture 20 LAST TIME: UNIX PROCESS MODEL Began covering the UNIX process model and API Information associated with each process: A PID (process ID) to
More informationProblem Set 1: Unix Commands 1
Problem Set 1: Unix Commands 1 WARNING: IF YOU DO NOT FIND THIS PROBLEM SET TRIVIAL, I WOULD NOT RECOMMEND YOU TAKE THIS OFFERING OF 300 AS YOU DO NOT POSSESS THE REQUISITE BACKGROUND TO PASS THE COURSE.
More informationRover Documentation Tracing with Perf, Conversion to CTF, and analysis with TraceCompass
Rover Documentation Tracing with Perf, Conversion to CTF, and analysis with TraceCompass Version Implementation Supervision & revision June 7, 207 Mustafa O zceliko rs Robert Ho ttger mozcelikors@gmail.com
More informationCommand Line Interface / Application Programming Interface (cliapi) Kevin Sheldrake rtfc.org.uk
Command Line Interface / Application Programming Interface (cliapi) Kevin Sheldrake rtfc.org.uk WTF? cliapi is a tool that runs individual functions in an executable or library on linux. Sometimes a function
More informationAnalyzing Kernel Behavior by SystemTap
Analyzing Kernel Behavior by SystemTap Kernel Tracer Approach 2009/2/25 Hitachi, Ltd., Software Division Noboru Obata ( ) Hitachi, Ltd. 2009. All rights reserved. Contents 1. Improving RAS Features for
More informationProcesses. Johan Montelius KTH
Processes Johan Montelius KTH 2017 1 / 47 A process What is a process?... a computation a program i.e. a sequence of operations a set of data structures a set of registers means to interact with other
More informationOS lpr. www. nfsd gcc emacs ls 9/18/11. Process Management. CS 537 Lecture 4: Processes. The Process. Why Processes? Simplicity + Speed
Process Management CS 537 Lecture 4: Processes Today: processes and process management what are the OS units of execution? how are they represented inside the OS? how is the CPU scheduled across processes?
More informationDebugging of CPython processes with gdb
Debugging of CPython processes with gdb KharkivPy January 28th, 2017 by Roman Podoliaka, Development Manager at Mirantis twitter: @rpodoliaka blog: http://podoliaka.org slides: http://podoliaka.org/talks/
More informationIntroducing LLDB for Linux on Arm and AArch64. Omair Javaid
Introducing LLDB for Linux on Arm and AArch64 Omair Javaid Agenda ENGINEERS AND DEVICES WORKING TOGETHER Brief introduction and history behind LLDB Status of LLDB on Linux and Android Linaro s contributions
More informationProcesses, Exceptional
CIS330, Week 9 Processes, Exceptional Control Flow CSAPPe2, Chapter 8 Control Flow Computers do Only One Thing o From startup to shutdown, a CPU simply reads and executes (interprets) a sequence of instructions,
More informationA process. the stack
A process Processes Johan Montelius What is a process?... a computation KTH 2017 a program i.e. a sequence of operations a set of data structures a set of registers means to interact with other processes
More informationCSE 153 Design of Operating Systems Fall 2018
CSE 153 Design of Operating Systems Fall 2018 Lecture 4: Processes (2) Threads Process Creation: Unix In Unix, processes are created using fork() int fork() fork() Creates and initializes a new PCB Creates
More informationHint #1. Define a syscall
PC 5 System call Exercice Clone the git repository git clone http://gitlab.montefiore.ulg.ac.be/info0940/kernel-4.4.50.git Make a "PC4" branch Add a sys_forkexec system call It is the equivalent of calling
More informationParallel architectures are enforcing the need of managing parallel software efficiently Sw design, programming, compiling, optimizing, running
S.Bartolini Department of Information Engineering University of Siena, Italy C.A. Prete Department of Information Engineering University of Pisa, Italy GREPS Workshop (PACT 07) Brasov, Romania. 16/09/2007
More informationLecture 4 Processes. Dynamic Analysis. GDB
Lecture 4 Processes. Dynamic Analysis. GDB Computer and Network Security 23th of October 2017 Computer Science and Engineering Department CSE Dep, ACS, UPB Lecture 4, Processes. Dynamic Analysis. GDB 1/45
More informationDTrace for Web2.0 JavaScript, PHP and Coolstack (SAMP) Philip Torchinsky Solaris Evangelist Sun Microsystems
DTrace for Web2.0 JavaScript, PHP and Coolstack (SAMP) Philip Torchinsky Solaris Evangelist Sun Microsystems 1 Agenda Why should you care?? Introduction to DTrace DTrace and JavaScript DTrace on the BackEnd
More informationDEBUGGING: DYNAMIC PROGRAM ANALYSIS
DEBUGGING: DYNAMIC PROGRAM ANALYSIS WS 2017/2018 Martina Seidl Institute for Formal Models and Verification System Invariants properties of a program must hold over the entire run: integrity of data no
More informationCollecting Linux Trace without using CodeWarrior
Freescale Semiconductor Application Note Document Number: AN5001 Collecting Linux Trace without using CodeWarrior 1. Introduction This document guides you how to collect Linux trace directly from QDS or
More informationRed Hat Developer Tools
Red Hat Developer Tools 2018.4 Using Clang and LLVM Toolset Installing and Using Clang and LLVM Toolset Last Updated: 2018-11-29 Red Hat Developer Tools 2018.4 Using Clang and LLVM Toolset Installing
More informationRed Hat Summit 2009 William Cohen
1 UNDERSTANDING COMPUTER PERFORMANCE WITH SYSTEMTAP William Cohen Performance Tools Engineer Red Hat September 2, 2009 Agenda What is SystemTap? How does SystemTap work? Setting up SystemTap Very simple
More informationDebugging realtime application with Ftrace
Debugging realtime application with Ftrace Pierre Ficheux (pierre.ficheux@smile.fr) 02/2018 1 Disclaimer Poor English speaker! But good French speaker and writer :-) Loin du français je meurs (Louis-Ferdinand
More informationAnnouncement (1) sys.skku.edu is now available
Processes Prof. Jin-Soo Kim( jinsookim@skku.edu) TA JinHong Kim( jinhong.kim@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Announcement (1) sys.skku.edu is now available
More informationExceptional Control Flow Part I Oct. 28, 2009"
Exceptional Control Flow Part I Oct. 28, 2009" Control Flow" Time" Physical control flow" " inst 1 " inst 2 " inst 3 " " inst n " " 2! 3! Altering the Control Flow" Exceptional Control
More informationExceptional Control Flow: Exceptions and Processes
Exceptional Control Flow: Exceptions and Processes 15-213 / 18-213: Introduction to Computer Systems 12 th Lecture, June 18, 2013 Instructors: Greg Kesden 1 Today Exceptional Control Flow Processes 2 Control
More informationDevelopment Environment Embedded Linux Primer Ch 1&2
Development Environment Embedded Linux Primer Ch 1&2 Topics 1) Systems: Host and Target 2) Host setup 3) Host-Target communication CMPT 433 Slides #3 Dr. B. Fraser 18-05-05 2 18-05-05 1 Host & Target Host
More informationFork() System Call and Processes. CS449 Fall 2017
Fork() System Call and Processes CS449 Fall 2017 Programs and Processes Program: Executable binary (code and stabc data) Process: A program loaded into memory Program (executable binary with data and text
More informationProcesses: Introduction. CS 241 February 13, 2012
Processes: Introduction CS 241 February 13, 2012 1 Announcements MP2 due tomorrow Deadline and contest cutoff 11:59 p.m. Fabulous prizes on Wednesday MP3 out Wednesday: Shell (1 week) Code from this lecture
More informationAre branches/calls the only way we can get the processor to go somewhere in a program? What is a program? A processor? A process?
Processes and control flow Are branches/calls the only way we can get the processor to go somewhere in a program? What is a program? A processor? A process? 1 Control Flow Processors do only one thing:
More informationMaintaining Linux Long Term & Adding Specific Features in Telecom Systems. Keika Kobayashi NEC Communication Systems Sep 29, Japan2010
Maintaining Linux Long Term & Adding Specific Features in Telecom Systems Keika Kobayashi NEC Communication Systems Sep 29, 2010@LinuxCon Japan2010 OUTLINE 1. Background 2. What we did 1. Keep kernel stable.
More informationfork System-Level Function
Princeton University Computer Science 217: Introduction to Programming Systems Process Management Goals of this Lecture Help you learn about: Creating new processes Waiting for processes to terminate Executing
More informationProcesses. CSE 351 Autumn Instructor: Justin Hsia
Processes CSE 351 Autumn 2016 Instructor: Justin Hsia Teaching Assistants: Chris Ma Hunter Zahn John Kaltenbach Kevin Bi Sachin Mehta Suraj Bhat Thomas Neuman Waylon Huang Xi Liu Yufang Sun https://xkcd.com/627/
More informationLinux Strace tool user guide
Linux Strace tool user guide 2017-10-13 Reversion Record Date Rev Change Description Author 2017-10-13 V0.1 Initial Zhang Yongchang 1 / 9 catalog 1 PURPOSE...4 2 TERMINOLOGY...4 3 ENVIRONMENT...4 3.1 HARDWARE
More informationUbiquitous System Analysis Performance Co Pilot. Abegail Jakop Lukas Berk Red Hat Oct. 23, 2014
Ubiquitous System Analysis Performance Co Pilot Abegail Jakop Lukas Berk Red Hat Oct. 23, 2014 Introduction 2 PCP Overview Introduction Components Recent Developments PAPI pmda pmwebd Deeper metrics Questions?
More informationCPSC 341 OS & Networks. Processes. Dr. Yingwu Zhu
CPSC 341 OS & Networks Processes Dr. Yingwu Zhu Process Concept Process a program in execution What is not a process? -- program on a disk A process is an active object, but a program is just a file It
More informationPrinceton University Computer Science 217: Introduction to Programming Systems. Process Management
Princeton University Computer Science 217: Introduction to Programming Systems Process Management 1 Goals of this Lecture Help you learn about: Creating new processes Waiting for processes to terminate
More informationThe Kernel Abstraction. Chapter 2 OSPP Part I
The Kernel Abstraction Chapter 2 OSPP Part I Kernel The software component that controls the hardware directly, and implements the core privileged OS functions. Modern hardware has features that allow
More informationProgramming Project 1: Introduction to the BLITZ Tools
Programming Project 1: Introduction to the BLITZ Tools Due Date: 2nd October 2017 before 11:30 AM. Duration: One Week Overview and Goal In this course you will be creating an operating system kernel. You
More informationIntroduction to Process in Computing Systems SEEM
Introduction to Process in Computing Systems SEEM 3460 1 Programs and Processes One way to describe the hardware of a computer system is to say that it provides a framework for executing programs and storing
More informationProcess management. What s in a process? What is a process? The OS s process namespace. A process s address space (idealized)
Process management CSE 451: Operating Systems Spring 2012 Module 4 Processes Ed Lazowska lazowska@cs.washington.edu Allen Center 570 This module begins a series of topics on processes, threads, and synchronization
More informationIndium Documentation. Release Nicolas Petton
Indium Documentation Release 1.2.0 Nicolas Petton Nov 23, 2018 Contents 1 Table of contents 3 1.1 Installation................................................ 3 1.2 Getting up and running..........................................
More informationTUTORIAL: Quickstart with freediameter
38 TUTORIAL: Quickstart with freediameter How to compile and run freediameter in a simple testbed. Tutorial: Creating a fd testbed 39 Goal : create a simple testbed Two nodes: one client, one server Run
More informationAndroid Debugging and Performance Analysis
Hands On Exercises for Android Debugging and Performance Analysis v. 2018.10 -- Day 1 WARNING: The order of the exercises does not always follow the same order of the explanations in the slides. When carrying
More informationECE 471 Embedded Systems Lecture 5
ECE 471 Embedded Systems Lecture 5 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 13 September 2016 HW#2 is due Thursday It is going OK? Announcements 1 Homework #1 Review Characteristics
More informationTips on Using GDB to Track Down and Stamp Out Software Bugs
Tips on Using GDB to Track Down and Stamp Out Software Bugs Brett Viren Physics Department MINOS Week In The Woods, 2005 Brett Viren (Brookhaven National Lab) Using GDB to Debug Ely 2005 1 / 34 Outline
More informationIntroduction to Supercomputing
Introduction to Supercomputing TMA4280 Introduction to UNIX environment and tools 0.1 Getting started with the environment and the bash shell interpreter Desktop computers are usually operated from a graphical
More informationSystemTap/DTrace with MySQL & Drizzle
SystemTap/DTrace with MySQL & Drizzle Padraig O'Sullivan Software Engineer, Akiban Tech. posullivan@akiban.com http://posulliv.github.com/ These slides released under the Creative Commons Attribution Noncommercial
More information