Giter Site home page Giter Site logo

linux-ftrace's Introduction

Linux ftrace Scripts

This repo has some ftrace scripts to interact with the linux ftrace subsystem. Instead of using this scripts, you can also directly interact with it using those sys files. The scripts is just a wrapper.

Usage

Enable tracing:

  • set_ftrace_filter.sh: enable classical ftrace on selected functons
  • set_graph_function.sh: enable to dump function call graph on selected functons

Dump trace (after you have enabled one of the above modes):

  • cat_trace_file.sh

Disable tracing:

  • disable.sh

For both tracing modes, select the functions by selectively enabling echo XXX >> $DIR/set_ftrace_filter.

All these script files are very simple and takes no argument to run. If you wish to change anything, modify the scripts directly.

Tips for tracing pgfaults

Originally, I wrote these scripts to trace pgfaults.

  • Some caveats

    • Pay close attention to hugepage usage if you are measuing pgfault latency in userspace with a high version kernel.
      • echo never > /sys/kernel/mm/transparent_hugepage/enabled
      • cat /proc/meminfo
    • Drop page cache if needed
      • echo 3 > /proc/sys/vm/drop_caches
  • Misc

    • Trace major/minor pgfaults in an easy way:
      • e.g., /usr/bin/time ls
    • Easy way to verify if any hugepage func is called within kernel
      • echo __do_page_fault >> set_graph_function, then search huge within trace.
    • Create file with certain size
      • dd if="/dev/zero" of=output.txt bs=4096 count=10

linux-ftrace's People

Contributors

lastweek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.