ftrace

How to trace just system call events with ftrace without showing any other functions in the Linux kernel?

淺唱寂寞╮ 提交于 2019-12-28 18:55:30
问题 For example, to monitor all mkdir calls made, the best I could come up with was: #!/bin/sh set -eux d=debug/tracing mkdir -p debug if ! mountpoint -q debug; then mount -t debugfs nodev debug fi # Stop tracing. echo 0 > "${d}/tracing_on" # Clear previous traces. echo > "${d}/trace" # Enable tracing mkdir echo sys_enter_mkdir > "${d}/set_event" # Set tracer type. echo function > "${d}/current_tracer" # Filter only sys_mkdir as a workaround. echo SyS_mkdir > "${d}/set_ftrace_filter" # Start

Are tracepoints redundant in Linux kernel after kprobes support for ftrace?

半世苍凉 提交于 2019-12-23 13:59:07
问题 What are the use-cases for using tracepoint events when kprobe events support for ftrace is available in Linux kernel? It seems everything that is possible to be done using 'tracepoint events' is possible using kprobe events, since one can set up a kprobe event to at the same point where tracepoint event is available. Am I missing something? 回答1: Since kprobes trace arbitrary functions, tools relying on them may easily break from one Linux version to the next . For instance, the name of the

Printing CPU number similar to ftrace

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 18:44:31
问题 I want to print CPU number on which the current process or function is executing similar to ftrace like this: TASK-PID CPU# TIMESTAMP FUNCTION | | | | | <idle>-0 [002] 23636.756054: ttwu_do_activate.constprop.89 <-try_to_wake_up <idle>-0 [002] 23636.756054: activate_task <-ttwu_do_activate.constprop.89 <idle>-0 [002] 23636.756055: enqueue_task <-activate_task How do I get that value? I suppose its there in some function of start_kernel function. Can we print its value? I am using linux-4.1

How do I use async_start and async_stop in systrace/atrace for Android

蹲街弑〆低调 提交于 2019-12-11 09:47:47
问题 I want to capture Systrace report on my Android phone while doing automated testing. It is unknown how long the testing will take, so I can't specify the --time period for the Systrace. Digging deeper in to the systrace.py , I found out that systrace is using atrace to get the kernel logs. I used adb shell atrace --help and got the following output: usage: atrace [options] [categories...] options include: -a appname enable app-level tracing for a comma separated list of cmdlines -b N use a

How does ftrace track interrupt service routines?

血红的双手。 提交于 2019-12-11 07:04:32
问题 ftrace is used for function tracing of kernel. Now how does it work for interrupts. Can it track kernel functions in interrupt mode. If so can you explain how it works. I am trying to write a function that tracks function calls and it works fine in Supervisor mode but does not work in interrupt mode (goes into loop). I need to make it work in IRQ mode. 回答1: As in Linux kernel ARM exception stack init details, the amount of IRQ stack used by Linux is minimal. ARM has several banked registers

How to Enable or configure ftrace module

喜夏-厌秋 提交于 2019-12-11 06:28:29
问题 i'd like to use the advanced features of ftrace but i dit not figure out how. debugfs is mounted but there is no "tracing"-folder in /sys/kernel/debug. i am running a ARM-Target @ Angstrom distro build via yocto, please see : Image: uname -a & lsb_release -a output zcat /proc/config.gz | grep TRACER|FTRACE output How to configure the kernel ? which options i have to set? 回答1: Add below kernel config options in your yocto project conf/local.conf file & then clean & rebuild linux kernel. KERNEL

ftrace: system crash when changing current_tracer from function_graph via echo

半世苍凉 提交于 2019-12-10 12:28:11
问题 I have been playing with ftrace recently to monitor some behavior characteristics of my system. I've been handling switching the trace on/off via a small script. After running the script, my system would crash and reboot itself. Initially, I believed that there might be an error with the script itself, but I have since determined that the crash and reboot is a result of echo ing some tracer to /sys/kernel/debug/tracing/current_tracer when current_tracer is set to function_graph. That is, the

Linux kernel's ftrace output format

Deadly 提交于 2019-12-08 03:52:31
问题 I'm using ftrace on Android on a couple of different devices, but I noticed that the output format differs between them. In some cases, the TGID of the current process is included, while in others, it is not. The TGID is very useful in the current application I'm using ftrace on, and I'm wondering how I could enable that. I'm aware of the sysfs file "/sys/kernel/debug/tracing/options/print-tgid", but this isn't available on my devices, unfortunately. Are there any kernel options or ftrace

Ftrace on android freeze when turn on function trace, somebody help me :(

隐身守侯 提交于 2019-12-07 13:57:36
问题 I have installed Ftrace on android AVD and try to use Ftrace's functionality, but it does not work. Below is a list of what I did: Install ubuntu 10.04 LTS Install essential tools such as android sdk, toolchain, libs, etc Download goldfish kernel refer - http://blog.markloiseau.com/2012/07/how-to-compile-the-android-goldfish-emulator-kernel/ Modify kernel config file (turned on Tracer Options) Boot up goldfish with custom kernel which has compiled with tracer options Tried to use Ftrace

Capturing user-space assembly with ftrace and kprobes (by using virtual address translation)?

时光怂恿深爱的人放手 提交于 2019-12-07 05:06:17
问题 Apologies for the longish post, I'm having trouble formulating it in a shorter way. Also, maybe this is more appropriate for Unix & Linux Stack Exchange, but I'll try here at SO first, as there is an ftrace tag. Anyways - I'd like to observe do machine instructions of a user program execute in the context of a full function_graph capture using ftrace . One problem is that I need this for an older kernel: $ uname -a Linux mypc 2.6.38-16-generic #67-Ubuntu SMP Thu Sep 6 18:00:43 UTC 2012 i686