Git Product home page Git Product logo

linux's Introduction

Linux port of DTrace

Dec 2015 Paul D. Fox [email protected] http://www.twitter.com/crispeditor http://www.crispeditor.co.uk

Blog - latest news and stuff about the dtrace project:

http://crtags.blogspot.com/ http://www.crispeditor.co.uk/blog/

Download dtrace tarballs for linux here:

https://github.com/dtrace4linux/linux ftp://crispeditor.co.uk/pub/release/website/dtrace

Introduction

This is a port of the Sun DTrace user and kernel code to Linux. No linux kernel code is touched in this build, but what is produced is a dynamically loadable kernel module. This avoids licensing issues and allows people to load and update dtrace as they desire.

The goal of this project is to make available DTrace for the Linux platforms. By making it available for everyone, they can use it to optimise their systems and tools, and in return, I get to benefit from their work.

PayPal

If you want to make a donation for this software, feel free to do so. Nothing is asked of you - it is genuinely free software, but it can help guage interest and appreciation if you do.

You can pay by visiting the link below and clicking on "Donate", or use this reference for donations:

Licensing

The original DTrace is licensed under Sun's (now Oracle) CDDL license. Original copyrights are left intact. No GPL code is incorporated into the release, to avoid legal conflicts.

Any mistakes or omissions in copyright attribution will be my mistake, so please let me know if there are such cases.

The linux kernel was referred to in order to engineer the glue for dtrace behavior, and there is no intention of making this code fall under anything other than CDDL. (If Oracle migrate to a GPL friendly license, then this port of dtrace can follow). I do not own the license or assert any rights on the licensing other than that expected of me as a consumer/supplier.

I have no political affiliation or preference for a licensing scheme, simply that Sun/Oracle has gracefully donated to the community a large body of work.

I reserve the right to change the licensing model for my own code at a later date, when and if someone puts forward a case as to the correct license agreement.

If the code is useful to you - great. Spread it around and get people to use, debug and enhance it.

GIT Repository

https://github.com/dtrace4linux/linux

(Theres an older and orphaned github repository under Peter McCormicks name, please ignore this as it has not been updated in a long while and is no longer active).

Installation

You may need to grab some extra packages for building DTrace. Use either of the following to download extra packages. This list may be incomplete depending on the version of your kernel/distro.

$ tools/get-deps-arch.sh	# if using ArchLinux
$ tools/get-deps.pl 		# if using Ubuntu
$ tools/get-deps-fedora.sh	# RedHat/Fedora

$ make all
$ make install
$ make load           (need to be root or have sudo access)

If the libdwarf package installed on the system is too old it still compiles without any problem, but you will get runtime errors from the io.d and/or sched.d files due to undefined kernel structure definitions.

If you get a undefined struct definition such as dtrace_cpu_t when running, please upgrade it.

Tested successfully with version 20100214 (whereas 20080409 is to old).

More details

Building is done in a build/ directory. The makefiles allow you to compile for alternate kernel releases in the same tree, which is useful for cross-version checking.

The result is:

build/dtrace               User land executable
build/drti.o               Object file for USDT apps
build/driver/dtracedrv.ko  Kernel loadable module

Installing will copy them to Solaris compliant locations:

/usr/sbin/dtrace
/usr/lib/dtrace/64/drti.o

You dont need to 'install' to run dtrace, but you will need to load the driver.

Kernel versioning

dtrace relies on a kernel module and so a binary is needed per system you deploy to, or kernel version.

dtrace is sensitive to the kernel - and attempts to cater for that, but very old, or very new kernels may not have been validated. Please feed back if that is the case.

A kernel strack trace is expected when loading the module, due to currently unknown reasons (the current theory is that the kernel ftrace mechanism which probes dtrace as its loaded gets confused by what it sees).

If you get a stack trace something like this in the logs when loading the module, this can safely be ignore (it appears to be no harm (unless you use system-tap and dtrace at the same time, then there could be a conflict):

[  182.556392] dtracedrv: module license 'CDDL' taints kernel.
[  182.556396] Disabling lock debugging due to kernel taint
[  184.760136] CPU: 5 PID: 11008 Comm: dtrace Tainted: P           O 3.12.0+scst+tf.1 #5
[  184.760140] Hardware name: To be filled by O.E.M. To be filled by O.E.M./SABERTOOTH 990FX, BIOS 0901 11/24/2011
[  184.760142]  ffffffffa093c8a0 ffffffff813c18b9 ffff8800dacdaa80 ffffffffa08f28ed
[  184.760146]  755f6f745f646162 ffff8800dacdaa80 ffff88040acbbb9c 0000000000000020
[  184.760149]  0000000000000001 ffffffffa09370c0 ffff8800dd020a80 ffffffffa08e7f3e
[  184.760151] Call Trace:
[  184.760156]  [<ffffffff813c18b9>] ? dump_stack+0x41/0x58
[  184.760165]  [<ffffffffa08f28ed>] ? mutex_enter_common+0x2d/0xeb [dtracedrv]
[  184.760172]  [<ffffffffa08e7f3e>] ? par_alloc+0x20/0xd0 [dtracedrv]
[  184.760178]  [<ffffffffa08f0894>] ? instr_provide_module+0x31/0x1f5 [dtracedrv]
[  184.760184]  [<ffffffffa08f489c>] ? sdt_open+0x3/0x3 [dtracedrv]
[  184.760189]  [<ffffffffa08f2980>] ? mutex_enter_common+0xc0/0xeb [dtracedrv]
[  184.760195]  [<ffffffffa08d83d0>] ? dtrace_probe_provide+0xcd/0xf7 [dtracedrv]
[  184.760201]  [<ffffffffa08d844f>] ? dtrace_open+0x55/0x10f [dtracedrv]
[  184.760203]  [<ffffffff812b3e60>] ? kobj_lookup+0xfc/0x133
[  184.760209]  [<ffffffffa08e7400>] ? dtracedrv_open+0x4c/0x51 [dtracedrv]
[  184.760212]  [<ffffffff812a3973>] ? misc_open+0x107/0x168
[  184.760216]  [<ffffffff8112c091>] ? chrdev_open+0x129/0x148
[  184.760218]  [<ffffffff8112bf68>] ? cdev_put+0x1a/0x1a
[  184.760220]  [<ffffffff81127082>] ? do_dentry_open+0x16c/0x22b
[  184.760221]  [<ffffffff8112720f>] ? finish_open+0x2c/0x35
[  184.760224]  [<ffffffff81134d9d>] ? do_last+0x9fd/0xc4a
[  184.760226]  [<ffffffff81135249>] ? path_openat+0x25f/0x5bd
[  184.760228]  [<ffffffff81141561>] ? mntput_no_expire+0x1b/0x16c
[  184.760230]  [<ffffffff811356a2>] ? do_filp_open+0x2d/0x75
[  184.760233]  [<ffffffff8111e32c>] ? kmem_cache_alloc+0x114/0x194
[  184.760235]  [<ffffffff813c4d93>] ? _raw_spin_unlock+0x9/0xb
[  184.760237]  [<ffffffff8113fa09>] ? __alloc_fd+0xfa/0x10c
[  184.760239]  [<ffffffff81126cfa>] ? do_sys_open+0x146/0x1d6
[  184.760241]  [<ffffffff813c7909>] ? ia32_do_call+0x13/0x13

No Linux Kernel source modifications required

This is important for a number of reasons -- unless dtrace is accepted into the kernel, it has to live with changes to header files and data structures. Also, from a licensing perspective it is not valid for dtrace to touch your sources. It is also much easier to not even require kernel sources - so long as a kernel build environment is available.

INSTALLATION

Run make with no arguments to see the current options. You may need to run one of the tools/get-deps scripts for your OS flavor to ensure you have the tools and kernel build environment for your kernel.

make all
    to compile the drivers and user space commands. Check the file
    Packages, for hints on what you need (not much, but libelf, kernel
    source, flex/yacc -- bison will do).

make install
    Copy dtrace binary and driver to correct install location.

make load
    To load the drivers, and then you can play with cmd/dtrace/dtrace.

make unl
    to unload the drivers.

make test
    To run the userland cmd/dtrace regression test

To build the userland (command and object file etc) and the kernel module for different architectures, set the environment variable BUILD_ARCH appropriately and then use the make targets separately.

This example is for building on a system with a 64-bit kernel, but with 32-bit userland:

   BUILD_ARCH=i386 make cmds
   BUILD_ARCH=x86_64 make kernel

Dependencies

To build dtrace for linux requires a number of tools - mostly the basic Unix development tools, plus you will need the kernel source/build tree. dtrace does not affect or touch your kernel sources, but it needs the normal header files for creating a loadable module.

Examine the following scripts to help identify missing packages:

tools/get-deps-arch.sh
tools/get-deps-fedora.sh
tools/get-deps.pl

Internet scripts

Many scripts on the 'Net won't work since they tend to assume a Solaris kernel, but if you look at them and read them to learn, then they can mostly be adapted for Linux.

linux's People

Contributors

apriendeau avatar azat avatar derekdai avatar dtrace4linux avatar fransurbo avatar kedazo avatar loganbruns avatar lordi avatar msabramo avatar ryao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux's Issues

install documentation ?

Hi,
I really want to test dtrace on linux but I failed until now, are there some recent documentation on getting up and running with a recent distribution stock install ?
And are the 3.x kernels supported ?

I tried to compile dtrace with an Ubuntu 11 on which I used a 2.6 kernel from an ubuntu 10.04 (2.6.38) but I had a hard time putting every pieces together and in the end I have a module which cannot be loaded in my running kernel :/

kernel panic on 3.2

I got a kernel panic right when I tried installing dtrace, here are the logs: https://gist.github.com/2954385
The first file is what was written to stdout from the time I typed "make install" up to the kernel panic, the second file are the kernel logs I managed to get.

After a reboot I managed to run "make install" without crashing.

Edit: more infos on my kernel:

$ uname -a
Linux main 3.2.0-23-virtual #36-Ubuntu SMP Tue Apr 10 22:29:03 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

panic on fedora 18 while trying to run "make test"

Hi,

I compiled and installed the dtrace on fedora 18 x86_64 machine.

When I type command, "make test", I get system panic and system hangs for infinitely and need to take take out and reinsert the battery to boot the laptop again.

Machine details:
[smita@localhost ~]$ uname -a
Linux localhost.localdomain 3.7.9-201.fc18.x86_64 #1 SMP Mon Feb 18 21:07:56 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Thanks,
Kiran.

Is the pid provider supported?

marca@ubuntu:~/src/dtrace4linux/newlinux/tests$ sudo dtrace -P pid
dtrace: invalid probe specifier pid: probe description pid::: does not match any probes

Build problem about commit 8e99c7d

Dear:

I got some problems about building dtrace4linux on this commit.

The following error message:

tools/mkdriver.pl driver-2 all
symlink ../../driver-2/Makefile build-3.2.0-23-generic/driver-2/Makefile
Executing: /root/linux/tools/make-me
make -C /lib/modules/3.2.0-23-generic/build M=/root/linux/build-3.2.0-23-generic/driver-2
scripts/Makefile.build:44: /root/linux/build-3.2.0-23-generic/driver-2/Makefile: No such file or directory

Looks like symbol link point to the null file (makefile)

did the tools/mkdriver.pl work right?
(I try to modified to link the correct make file but I still meet other problems)

Could I ask about what task the driver-2 take?

Thanks

Vicente

Can't load dtracedrv.ko; unknown symbols: ctf_init and ctf_exit

I finally was able to build from the head of the github repo, but now I can't load the kernel module, dtracedrv.ko:

marca@ubuntu:~/src/dtrace4linux/newlinux$ make all
...
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/vminfo.c:46: warning: 'sdt_add_locator' defined but not used
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/vminfo.c:66: warning: 'vminfo_instr_callback' defined but not used
  CC [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/x_call.o
  CC [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/divmod64.o
  LD [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "ctf_exit" [/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.ko] undefined!
WARNING: "ctf_init" [/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.ko] undefined!
  CC      /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.mod.o
  LD [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.ko
tools/mkctf.sh
-rw-r--r-- 1 marca marca 96284 Feb 29 14:45 build/linux-2.6.32-38-generic.ctf
sync
marca@ubuntu:~/src/dtrace4linux/newlinux$ sudo make load
tools/load.pl
14:47:50 Syncing...
14:47:50 Loading: build-2.6.32-38-generic/driver/dtracedrv.ko
insmod: error inserting 'build-2.6.32-38-generic/driver/dtracedrv.ko': -1 Unknown symbol in module

An error was detected loading the driver. Refer to
/var/log/messages or 'dmesg' to see what the issue
might be. For your convenience, here is the last few
lines from /var/log/messages:

===== tail -10 /var/log/messages
Feb 29 08:56:13 ubuntu kernel: [   99.802095] __ratelimit: 21 callbacks suppressed
Feb 29 08:56:13 ubuntu kernel: [   99.802098] type=1503 audit(1330534573.088:18):  operation="capable" pid=10204 parent=10200 profile="/usr/sbin/cupsd" name="sys_admin"
Feb 29 09:37:17 ubuntu kernel: [ 2560.567424] eth0: link down
Feb 29 09:37:28 ubuntu kernel: [ 2571.083710] eth0: link up
Feb 29 09:37:50 ubuntu kernel: [ 2593.050661] eth0: link down
Feb 29 09:38:00 ubuntu kernel: [ 2603.033176] eth0: link up
Feb 29 14:44:29 ubuntu kernel: [17366.909133] dtracedrv: module license 'CDDL' taints kernel.
Feb 29 14:44:29 ubuntu kernel: [17366.909153] Disabling lock debugging due to kernel taint
Feb 29 14:44:29 ubuntu kernel: [17366.909966] dtracedrv: Unknown symbol ctf_init
Feb 29 14:44:29 ubuntu kernel: [17366.910294] dtracedrv: Unknown symbol ctf_exit
make: *** [load] Error 1

I wonder is this is a side-effect of the change I made to replace the various .o files with libctf.a. Perhaps libctf.a doesn't have all of those object files...

No rule to make target ...driver/ctf_hash.o

make -C /lib/modules/2.6.32-38-generic/build M=/home/marca/src/dtrace4linux/linux/build-2.6.32-38-generic/driver
  LD      /home/marca/src/dtrace4linux/linux/build-2.6.32-38-generic/driver/built-in.o
make[3]: *** No rule to make target `/home/marca/src/dtrace4linux/linux/build-2.6.32-38-generic/driver/ctf_hash.o', needed by `/home/marca/src/dtrace4linux/linux/build-2.6.32-38-generic/driver/dtracedrv.o'.  Stop.
make[2]: *** [_module_/home/marca/src/dtrace4linux/linux/build-2.6.32-38-generic/driver] Error 2
make[1]: *** [kernel] Error 2
tools/bug.sh
======================
== Sorry - but dtrace failed to compile on your system.
== Please forward the following file to:
==
== file: /tmp/dtrace-bug.25778
== mail: [email protected]
==
== and the information provided will be used to help
== enhance the tool and fix the underlying issue.
==
== Latest news and blog updates on dtrace available here. Please
== check for latest problem reports.
==
== http://crtags.blogspot.com
== http://www.crisp.demon.co.uk/blog/
==
== Latest downloads available from here:
==
== ftp://crisp.dyndns-server.com/pub/release/website/dtrace
== ======================
(generating a make run - this may take a few moments...)

Panic running systrace-stringof-bad, kernel 3.2

This is a log from it running in a KVM node. I ran the test on my laptop (also 3.2) and got a panic but did not spend the time to hook up a netconsole.
Linux debian 3.2.0-2-amd64 #1 SMP Mon Apr 30 05:20:23 UTC 2012 x86_64 GNU/Linux

I modified the source to build on Debian ( #45 ).
Let me know if there is anything else I can provide. I tried building with dtrace_printf() uncomented in dtrace_int_page_fault_handler() and it paniced in a different way, I suspect calling dtrace_printf() might have triggered another page fault.

[ 1431.895203] BUG: unable to handle kernel NULL pointer dereference at 0000000000000091
[ 1431.896036] IP: [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.896036] PGD 7a79e067 PUD 798be067 PMD 0 
[ 1431.896036] Oops: 0000 [#1] SMP 
[ 1431.896036] CPU 3 
[ 1431.896036] Modules linked in: dtracedrv(P) loop snd_pcm snd_page_alloc snd_timer snd soundcore psmouse processor parport_pc thermal_sys evdev pcspkr serio_raw i2c_piix4 i2c_core parport button ext4 crc16 jbd2 mbcache sr_mod sd_mod cdrom crc_t10dif ata_generic floppy 8139too 8139cp ata_piix mii libata scsi_mod [last unloaded: scsi_wait_scan]
[ 1431.896036] 
[ 1431.896036] Pid: 4808, comm: du Tainted: P        W  O 3.2.0-2-amd64 #1 Bochs Bochs
[ 1431.896036] RIP: 0010:[<ffffffffa01cbccd>]  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.896036] RSP: 0018:ffff880067527e80  EFLAGS: 00010282
[ 1431.896036] RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000030900
[ 1431.896036] RDX: 0000000001849eb8 RSI: 0000000000000006 RDI: 000000000003a32d
[ 1431.896036] RBP: 0000000000000000 R08: 0000000000000000 R09: 000000000183e650
[ 1431.896036] R10: 0000000000000003 R11: 0000000000000246 R12: 000000000003a32d
[ 1431.896036] R13: 0000000000000000 R14: 0000000001849eb8 R15: 0000000000000006
[ 1431.896036] FS:  00002ad3684c8b20(0000) GS:ffff88007fcc0000(0000) knlGS:00000000556e06c0
[ 1431.896036] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1431.896036] CR2: 0000000000000091 CR3: 00000000690f5000 CR4: 00000000000006e0
[ 1431.896036] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1431.896036] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1431.896036] Process du (pid: 4808, threadinfo ffff880067526000, task ffff88007aa289f0)
[ 1431.896036] Stack:
[ 1431.896036]  000000000183e650 0000000000000000 0000000000030900 0000000001849eb8
[ 1431.896036]  0000000000000006 000000000003a32d 0000000050ccc01c ffff88007aa45818
[ 1431.896036]  0000000000000000 ffffffffa01e69be 0000000000000003 0000000000000000
[ 1431.896036] Call Trace:
[ 1431.896036]  [<ffffffffa01e69be>] ? dtrace_systrace_syscall2+0xa5/0x231 [dtracedrv]
[ 1431.896036]  [<ffffffffa01e6cef>] ? dtrace_systrace_syscall+0xcf/0xd4 [dtracedrv]
[ 1431.896036]  [<ffffffff8134e212>] ? system_call_fastpath+0x16/0x1b
[ 1431.896036] Code: 44 24 08 4c 89 0c 24 e8 99 56 01 00 48 8b 80 c0 00 00 00 48 8b 54 24 18 48 8b 4c 24 10 48 8b 74 24 20 8b 7c 24 28 4c 8b 44 24 08 <f6> 80 91 00 00 00 02 4c 8b 0c 24 74 1c 83 3d 87 df 05 00 00 74 
[ 1431.896036] RIP  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.896036]  RSP <ffff880067527e80>
[ 1431.896036] CR2: 0000000000000091
[ 1431.902812] BUG: unable to handle kernel 
[ 1431.984819] ---[ end trace 3895f73ef2b14e68 ]---
[ 1431.902812] NULL pointer dereference at 0000000000000091
[ 1431.902812] IP: [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.902812] PGD 0 
[ 1431.902812] Oops: 0000 [#2] SMP 
[ 1431.902812] CPU 2 
[ 1431.902812] Modules linked in: dtracedrv(P) loop snd_pcm snd_page_alloc snd_timer snd soundcore psmouse processor parport_pc thermal_sys evdev pcspkr serio_raw i2c_piix4 i2c_core parport button ext4 crc16 jbd2 mbcache sr_mod sd_mod cdrom crc_t10dif ata_generic floppy 8139too 8139cp ata_piix mii libata scsi_mod [last unloaded: scsi_wait_scan]
[ 1431.902812] 
[ 1431.902812] Pid: 4854, comm: modprobe Tainted: P      D W  O 3.2.0-2-amd64 #1 Bochs Bochs
[ 1431.902812] RIP: 0010:[<ffffffffa01cbccd>]  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.902812] RSP: 0018:ffff88006751de80  EFLAGS: 00010282
[ 1431.902812] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 000000000005ad20
[ 1431.902812] RDX: 0000000000090800 RSI: 00007faf4073571d RDI: 000000000003a12f
[ 1431.902812] RBP: 0000000000000000 R08: 0000000000000000 R09: 3436646d612d322d
[ 1431.902812] R10: 00007fff8c8c1fa2 R11: 0000000000000246 R12: 000000000003a12f
[ 1431.902812] R13: 0000000000000000 R14: 0000000000090800 R15: 00007faf4073571d
[ 1431.902812] FS:  00007faf40708700(0000) GS:ffff88007fc80000(0000) knlGS:00000000556e06c0
[ 1431.902812] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1431.902812] CR2: 0000000000000091 CR3: 000000006b8e8000 CR4: 00000000000006e0
[ 1431.902812] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1431.902812] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1431.902812] Process modprobe (pid: 4854, threadinfo ffff88006751c000, task ffff8800684f0e20)
[ 1431.902812] Stack:
[ 1431.902812]  3436646d612d322d 0000000000000000 000000000005ad20 0000000000090800
[ 1431.902812]  00007faf4073571d 000000000003a12f 000000004feabb91 ffff88007aa44030
[ 1431.902812]  0000000000000000 ffffffffa01e69be 00007fff8c8c1fa2 0000000000000000
[ 1431.902812] Call Trace:
[ 1431.902812]  [<ffffffffa01e69be>] ? dtrace_systrace_syscall2+0xa5/0x231 [dtracedrv]
[ 1431.902812]  [<ffffffffa01e6cef>] ? dtrace_systrace_syscall+0xcf/0xd4 [dtracedrv]
[ 1431.902812]  [<ffffffff813497f5>] ? page_fault+0x25/0x30
[ 1431.902812]  [<ffffffff8134e212>] ? system_call_fastpath+0x16/0x1b
[ 1431.902812] Code: 44 24 08 4c 89 0c 24 e8 99 56 01 00 48 8b 80 c0 00 00 00 48 8b 54 24 18 48 8b 4c 24 10 48 8b 74 24 20 8b 7c 24 28 4c 8b 44 24 08 <f6> 80 91 00 00 00 02 4c 8b 0c 24 74 1c 83 3d 87 df 05 00 00 74 
[ 1431.902812] RIP  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.902812]  RSP <ffff88006751de80>
[ 1431.902812] CR2: 0000000000000091
[ 1431.900021] BUG: unable to handle kernel 
[ 1432.082166] ---[ end trace 3895f73ef2b14e69 ]---
[ 1432.083286] NULL pointer dereference at 0000000000000091
[ 1432.083286] IP: [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.083286] PGD 7a218067 PUD 6bbaf067 PMD 0 
[ 1432.083286] Oops: 0000 [#3] SMP 
[ 1432.083286] CPU 4 
[ 1432.083286] Modules linked in: dtracedrv(P) loop snd_pcm snd_page_alloc snd_timer snd soundcore psmouse processor parport_pc thermal_sys evdev pcspkr serio_raw i2c_piix4 i2c_core parport button ext4 crc16 jbd2 mbcache sr_mod sd_mod cdrom crc_t10dif ata_generic floppy 8139too 8139cp ata_piix mii libata scsi_mod [last unloaded: scsi_wait_scan]
[ 1432.083286] 
[ 1432.083286] Pid: 4573, comm: dtrace Tainted: P      D W  O 3.2.0-2-amd64 #1 Bochs Bochs
[ 1432.083286] RIP: 0010:[<ffffffffa01cbccd>]  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.083286] RSP: 0018:ffff88007fd03e70  EFLAGS: 00010282
[ 1432.083286] RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000000000
[ 1432.083286] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000003a64f
[ 1432.083286] RBP: ffff88006626de00 R08: 0000000000000000 R09: 0000000000000000
[ 1432.083286] R10: 0000000000000001 R11: ffff88007fd0e780 R12: 0000000000000000
[ 1432.083286] R13: 0000000000000001 R14: 0000000000000006 R15: ffff880066609fd8
[ 1432.083286] FS:  00002b259d23adc0(0000) GS:ffff88007fd00000(0000) knlGS:00000000556e06c0
[ 1432.083286] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1432.083286] CR2: 0000000000000091 CR3: 000000006c579000 CR4: 00000000000006e0
[ 1432.083286] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1432.083286] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1432.083286] Process dtrace (pid: 4573, threadinfo ffff880066608000, task ffff88007aa2c240)
[ 1432.083286] Stack:
[ 1432.083286]  0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 1432.083286]  0000000000000000 ffffffff0003a64f 0000000000000297 0000000000000001
[ 1432.083286]  ffff88006626de00 ffffffffa01baec9 0000000000000020 ffffffffa02020a0
[ 1432.083286] Call Trace:
[ 1432.083286]  <IRQ> 
[ 1432.083286]  [<ffffffffa01baec9>] ? cyclic_tasklet_func+0xc1/0xe6 [dtracedrv]
[ 1432.083286]  [<ffffffff8104b646>] ? tasklet_action+0x73/0xc2
[ 1432.083286]  [<ffffffff8104be30>] ? __do_softirq+0xb9/0x177
[ 1432.083286]  [<ffffffff8135046c>] ? call_softirq+0x1c/0x30
[ 1432.083286]  [<ffffffff8100f8e5>] ? do_softirq+0x3c/0x7b
[ 1432.083286]  [<ffffffff8104c098>] ? irq_exit+0x3c/0x9a
[ 1432.083286]  [<ffffffff81023fe8>] ? smp_apic_timer_interrupt+0x74/0x82
[ 1432.083286]  [<ffffffff8134ecde>] ? apic_timer_interrupt+0x6e/0x80
[ 1432.083286]  <EOI> 
[ 1432.083286]  [<ffffffffa01d7e3a>] ? dtrace_bzero+0xc/0xf [dtracedrv]
[ 1432.083286]  [<ffffffffa01d86c4>] ? kmem_zalloc+0x26/0x54 [dtracedrv]
[ 1432.083286]  [<ffffffffa01e9248>] ? dtrace_state_buffer+0x3b3/0x640 [dtracedrv]
[ 1432.083286]  [<ffffffffa01d175d>] ? dtrace_state_go+0x576/0xa75 [dtracedrv]
[ 1432.083286]  [<ffffffffa01c236b>] ? dtrace_strcmp+0x1b/0x1b [dtracedrv]
[ 1432.083286]  [<ffffffffa01d50f2>] ? dtrace_ioctl+0xc7c/0x217a [dtracedrv]
[ 1432.083286]  [<ffffffffa01d5996>] ? dtrace_ioctl+0x1520/0x217a [dtracedrv]
[ 1432.083286]  [<ffffffff810c912e>] ? zone_page_state_add+0x14/0x23
[ 1432.083286]  [<ffffffff810b3b14>] ? find_get_page+0x40/0x63
[ 1432.083286]  [<ffffffff810363c7>] ? should_resched+0x5/0x23
[ 1432.083286]  [<ffffffff81347f4f>] ? _cond_resched+0x7/0x1c
[ 1432.083286]  [<ffffffff810b3c36>] ? lock_page+0x11/0x20
[ 1432.083286]  [<ffffffff810b3cb6>] ? find_lock_page+0x29/0x4a
[ 1432.083286]  [<ffffffff810c5934>] ? shmem_getpage_gfp+0x8f/0x47d
[ 1432.083286]  [<ffffffff810b41a9>] ? generic_file_buffered_write+0x1e3/0x259
[ 1432.083286]  [<ffffffff810c673a>] ? shmem_getxattr+0x6e/0xca
[ 1432.083286]  [<ffffffff810b3b14>] ? find_get_page+0x40/0x63
[ 1432.083286]  [<ffffffff810363c7>] ? should_resched+0x5/0x23
[ 1432.083286]  [<ffffffff81347f4f>] ? _cond_resched+0x7/0x1c
[ 1432.083286]  [<ffffffff810b5978>] ? filemap_fault+0x1e6/0x33e
[ 1432.083286]  [<ffffffff810f5c0d>] ? lookup_page_cgroup+0x2d/0x42
[ 1432.083286]  [<ffffffff810f1605>] ? mem_cgroup_update_page_stat+0x17/0xd4
[ 1432.083286]  [<ffffffff810cdd75>] ? __do_fault+0x371/0x3ac
[ 1432.083286]  [<ffffffff810d0044>] ? handle_pte_fault+0x298/0x79f
[ 1432.083286]  [<ffffffff810cd621>] ? pte_offset_kernel+0x16/0x35
[ 1432.083286]  [<ffffffffa01d7c94>] ? dtracedrv_ioctl.isra.3+0x3c/0x4d [dtracedrv]
[ 1432.083286]  [<ffffffffa01d7cb5>] ? dtracedrv_unlocked_ioctl+0x6/0xa [dtracedrv]
[ 1432.083286]  [<ffffffff81106599>] ? do_vfs_ioctl+0x459/0x49a
[ 1432.083286]  [<ffffffff81106625>] ? sys_ioctl+0x4b/0x72
[ 1432.083286]  [<ffffffff8134e212>] ? system_call_fastpath+0x16/0x1b
[ 1432.083286] Code: 44 24 08 4c 89 0c 24 e8 99 56 01 00 48 8b 80 c0 00 00 00 48 8b 54 24 18 48 8b 4c 24 10 48 8b 74 24 20 8b 7c 24 28 4c 8b 44 24 08 <f6> 80 91 00 00 00 02 4c 8b 0c 24 74 1c 83 3d 87 df 05 00 00 74 
[ 1432.083286] RIP  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.083286]  RSP <ffff88007fd03e70>
[ 1432.083286] CR2: 0000000000000091
[ 1431.904071] BUG: unable to handle kernel 
[ 1432.262291] ---[ end trace 3895f73ef2b14e6a ]---
[ 1432.262294] Kernel panic - not syncing: Fatal exception in interrupt
[ 1432.262297] Pid: 4573, comm: dtrace Tainted: P      D W  O 3.2.0-2-amd64 #1
[ 1432.262299] Call Trace:
[ 1432.262300]  <IRQ>  [<ffffffff81342b3b>] ? panic+0x95/0x1a5
[ 1432.262310]  [<ffffffff8134a086>] ? oops_end+0xa9/0xb6
[ 1432.262313]  [<ffffffff81342487>] ? no_context+0x1ff/0x20e
[ 1432.262317]  [<ffffffff8134c099>] ? do_page_fault+0x1a8/0x337
[ 1432.262321]  [<ffffffff8104148d>] ? load_balance+0x85/0x629
[ 1432.262335]  [<ffffffffa004d96b>] ? ata_sff_hsm_move+0x5ed/0x616 [libata]
[ 1432.262344]  [<ffffffffa0007d51>] ? scsi_request_fn+0x33f/0x404 [scsi_mod]
[ 1432.262348]  [<ffffffff813497f5>] ? page_fault+0x25/0x30
[ 1432.262357]  [<ffffffffa01cbccd>] ? dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.262365]  [<ffffffffa01baec9>] ? cyclic_tasklet_func+0xc1/0xe6 [dtracedrv]
[ 1432.262368]  [<ffffffff8104b646>] ? tasklet_action+0x73/0xc2
[ 1432.262371]  [<ffffffff8104be30>] ? __do_softirq+0xb9/0x177
[ 1432.262375]  [<ffffffff8135046c>] ? call_softirq+0x1c/0x30
[ 1432.262378]  [<ffffffff8100f8e5>] ? do_softirq+0x3c/0x7b
[ 1432.262381]  [<ffffffff8104c098>] ? irq_exit+0x3c/0x9a
[ 1432.262385]  [<ffffffff81023fe8>] ? smp_apic_timer_interrupt+0x74/0x82
[ 1432.262388]  [<ffffffff8134ecde>] ? apic_timer_interrupt+0x6e/0x80
[ 1432.262389]  <EOI>  [<ffffffffa01d7e3a>] ? dtrace_bzero+0xc/0xf [dtracedrv]
[ 1432.262417]  [<ffffffffa01d86c4>] ? kmem_zalloc+0x26/0x54 [dtracedrv]
[ 1432.262424]  [<ffffffffa01e9248>] ? dtrace_state_buffer+0x3b3/0x640 [dtracedrv]
[ 1432.262433]  [<ffffffffa01d175d>] ? dtrace_state_go+0x576/0xa75 [dtracedrv]
[ 1432.262442]  [<ffffffffa01c236b>] ? dtrace_strcmp+0x1b/0x1b [dtracedrv]
[ 1432.262451]  [<ffffffffa01d50f2>] ? dtrace_ioctl+0xc7c/0x217a [dtracedrv]
[ 1432.262460]  [<ffffffffa01d5996>] ? dtrace_ioctl+0x1520/0x217a [dtracedrv]
[ 1432.262464]  [<ffffffff810c912e>] ? zone_page_state_add+0x14/0x23
[ 1432.262468]  [<ffffffff810b3b14>] ? find_get_page+0x40/0x63
[ 1432.262470]  [<ffffffff810363c7>] ? should_resched+0x5/0x23
[ 1432.262473]  [<ffffffff81347f4f>] ? _cond_resched+0x7/0x1c
[ 1432.262476]  [<ffffffff810b3c36>] ? lock_page+0x11/0x20
[ 1432.262479]  [<ffffffff810b3cb6>] ? find_lock_page+0x29/0x4a
[ 1432.262482]  [<ffffffff810c5934>] ? shmem_getpage_gfp+0x8f/0x47d
[ 1432.262486]  [<ffffffff810b41a9>] ? generic_file_buffered_write+0x1e3/0x259
[ 1432.262489]  [<ffffffff810c673a>] ? shmem_getxattr+0x6e/0xca
[ 1432.262492]  [<ffffffff810b3b14>] ? find_get_page+0x40/0x63
[ 1432.262494]  [<ffffffff810363c7>] ? should_resched+0x5/0x23
[ 1432.262497]  [<ffffffff81347f4f>] ? _cond_resched+0x7/0x1c
[ 1432.262500]  [<ffffffff810b5978>] ? filemap_fault+0x1e6/0x33e
[ 1432.262504]  [<ffffffff810f5c0d>] ? lookup_page_cgroup+0x2d/0x42
[ 1432.262507]  [<ffffffff810f1605>] ? mem_cgroup_update_page_stat+0x17/0xd4
[ 1432.262510]  [<ffffffff810cdd75>] ? __do_fault+0x371/0x3ac
[ 1432.262513]  [<ffffffff810d0044>] ? handle_pte_fault+0x298/0x79f
[ 1432.262516]  [<ffffffff810cd621>] ? pte_offset_kernel+0x16/0x35
[ 1432.262526]  [<ffffffffa01d7c94>] ? dtracedrv_ioctl.isra.3+0x3c/0x4d [dtracedrv]
[ 1432.262536]  [<ffffffffa01d7cb5>] ? dtracedrv_unlocked_ioctl+0x6/0xa [dtracedrv]
[ 1432.262539]  [<ffffffff81106599>] ? do_vfs_ioctl+0x459/0x49a
[ 1432.262543]  [<ffffffff81106625>] ? sys_ioctl+0x4b/0x72
[ 1432.262546]  [<ffffffff8134e212>] ? system_call_fastpath+0x16/0x1b
[ 1431.904071] NULL pointer dereference at 0000000000000091
[ 1431.904071] IP: [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.904071] PGD 0 
[ 1431.904071] Oops: 0000 [#4] SMP 
[ 1431.904071] CPU 5 
[ 1431.904071] Modules linked in: dtracedrv(P) loop snd_pcm snd_page_alloc snd_timer snd soundcore psmouse processor parport_pc thermal_sys evdev pcspkr serio_raw i2c_piix4 i2c_core parport button ext4 crc16 jbd2 mbcache sr_mod sd_mod cdrom crc_t10dif ata_generic floppy 8139too 8139cp ata_piix mii libata scsi_mod [last unloaded: scsi_wait_scan]
[ 1431.904071] 
[ 1431.904071] Pid: 4858, comm: modprobe Tainted: P      D W  O 3.2.0-2-amd64 #1 Bochs Bochs
[ 1431.904071] RIP: 0010:[<ffffffffa01cbccd>]  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.904071] RSP: 0018:ffff88006b8d9e80  EFLAGS: 00010282
[ 1431.904071] RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000000001
[ 1431.904071] RDX: 0000000000000000 RSI: 00007fabd90f32d0 RDI: 000000000003a12f
[ 1431.904071] RBP: 0000000000000000 R08: ffffffffffffffb0 R09: 00007fabd92fa570
[ 1431.904071] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000003a12f
[ 1431.904071] R13: 0000000000000000 R14: 0000000000000000 R15: 00007fabd90f32d0
[ 1431.904071] FS:  00002b2c6c40ab20(0000) GS:ffff88007fd40000(0000) knlGS:00000000556e06c0
[ 1431.904071] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1431.904071] CR2: 0000000000000091 CR3: 000000006753f000 CR4: 00000000000006e0
[ 1431.904071] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1431.904071] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1431.904071] Process modprobe (pid: 4858, threadinfo ffff88006b8d8000, task ffff880067909750)
[ 1431.904071] Stack:
[ 1431.904071]  00007fabd92fa570 ffffffffffffffb0 0000000000000001 0000000000000000
[ 1431.904071]  00007fabd90f32d0 ffff88000003a12f 0000000200000001 ffff88007aa44030
[ 1431.904071]  0000000000000000 ffffffffa01e69be 0000000000000000 00000000000000d0
[ 1431.904071] Call Trace:
[ 1431.904071]  [<ffffffffa01e69be>] ? dtrace_systrace_syscall2+0xa5/0x231 [dtracedrv]
[ 1431.904071]  [<ffffffff810ebb4f>] ? kmem_cache_alloc+0x86/0xea
[ 1431.904071]  [<ffffffffa01e6cef>] ? dtrace_systrace_syscall+0xcf/0xd4 [dtracedrv]
[ 1431.904071]  [<ffffffff813497f5>] ? page_fault+0x25/0x30
[ 1431.904071]  [<ffffffff8134e212>] ? system_call_fastpath+0x16/0x1b
[ 1431.904071] Code: 44 24 08 4c 89 0c 24 e8 99 56 01 00 48 8b 80 c0 00 00 00 48 8b 54 24 18 48 8b 4c 24 10 48 8b 74 24 20 8b 7c 24 28 4c 8b 44 24 08 <f6> 80 91 00 00 00 02 4c 8b 0c 24 74 1c 83 3d 87 df 05 00 00 74 
[ 1431.904071] RIP  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.904071]  RSP <ffff88006b8d9e80>
[ 1431.904071] CR2: 0000000000000091
[ 1431.996070] BUG: unable to handle kernel NULL pointer dereference at 0000000000000091
[ 1431.996070] IP: [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.996070] PGD 37121067 PUD 690e6067 PMD 0 
[ 1431.996070] Oops: 0000 [#5] SMP 
[ 1431.996070] CPU 0 
[ 1431.996070] Modules linked in: dtracedrv(P) loop snd_pcm snd_page_alloc snd_timer snd soundcore psmouse processor parport_pc thermal_sys evdev pcspkr serio_raw i2c_piix4 i2c_core parport button ext4 crc16 jbd2 mbcache sr_mod sd_mod cdrom crc_t10dif ata_generic floppy 8139too 8139cp ata_piix mii libata scsi_mod [last unloaded: scsi_wait_scan]
[ 1431.996070] 
[ 1431.996070] Pid: 4545, comm: tests.pl Tainted: P      D W  O 3.2.0-2-amd64 #1 Bochs Bochs
[ 1431.996070] RIP: 0010:[<ffffffffa01cbccd>]  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.996070] RSP: 0018:ffff88006bba5e80  EFLAGS: 00010282
[ 1431.996070] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000000000001b6
[ 1431.996070] RDX: 0000000000000000 RSI: 0000000001b34890 RDI: 000000000003a12f
[ 1431.996070] RBP: 0000000000000000 R08: 00002b2c6b556510 R09: 00000000000001b6
[ 1431.996070] R10: 00000000ffffffff R11: 0000000000000246 R12: 000000000003a12f
[ 1431.996070] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000001b34890
[ 1431.996070] FS:  00002b2c6c40ab20(0000) GS:ffff88007fc00000(0000) knlGS:00000000556e06c0
[ 1431.996070] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1431.996070] CR2: 0000000000000091 CR3: 000000007a64b000 CR4: 00000000000006f0
[ 1431.996070] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1431.996070] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1431.996070] Process tests.pl (pid: 4545, threadinfo ffff88006bba4000, task ffff88007c104040)
[ 1431.996070] Stack:
[ 1431.996070]  00000000000001b6 00002b2c6b556510 00000000000001b6 0000000000000000
[ 1431.996070]  0000000001b34890 000000000003a12f 0000000050ccc01c ffff88007aa44030
[ 1431.996070]  0000000000000000 ffffffffa01e69be 00000000ffffffff 0000000000000000
[ 1431.996070] Call Trace:
[ 1431.996070]  [<ffffffffa01e69be>] ? dtrace_systrace_syscall2+0xa5/0x231 [dtracedrv]
[ 1431.996070]  [<ffffffffa01e6cef>] ? dtrace_systrace_syscall+0xcf/0xd4 [dtracedrv]
[ 1431.996070]  [<ffffffff813497f5>] ? page_fault+0x25/0x30
[ 1431.996070]  [<ffffffff8134e212>] ? system_call_fastpath+0x16/0x1b
[ 1431.996070] Code: 44 24 08 4c 89 0c 24 e8 99 56 01 00 48 8b 80 c0 00 00 00 48 8b 54 24 18 48 8b 4c 24 10 48 8b 74 24 20 8b 7c 24 28 4c 8b 44 24 08 <f6> 80 91 00 00 00 02 4c 8b 0c 24 74 1c 83 3d 87 df 05 00 00 74 
[ 1431.996070] RIP  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1431.996070]  RSP <ffff88006bba5e80>
[ 1431.996070] CR2: 0000000000000091
[ 1432.088036] BUG: unable to handle kernel NULL pointer dereference at 0000000000000091
[ 1432.088036] IP: [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.088036] PGD 0 
[ 1432.088036] Oops: 0000 [#6] SMP 
[ 1432.088036] CPU 3 
[ 1432.088036] Modules linked in: dtracedrv(P) loop snd_pcm snd_page_alloc snd_timer snd soundcore psmouse processor parport_pc thermal_sys evdev pcspkr serio_raw i2c_piix4 i2c_core parport button ext4 crc16 jbd2 mbcache sr_mod sd_mod cdrom crc_t10dif ata_generic floppy 8139too 8139cp ata_piix mii libata scsi_mod [last unloaded: scsi_wait_scan]
[ 1432.088036] 
[ 1432.088036] Pid: 4864, comm: modprobe Tainted: P      D W  O 3.2.0-2-amd64 #1 Bochs Bochs
[ 1432.088036] RIP: 0010:[<ffffffffa01cbccd>]  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.088036] RSP: 0018:ffff88006b8d1e80  EFLAGS: 00010282
[ 1432.088036] RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000001
[ 1432.088036] RDX: 0000000000000000 RSI: 00007f8d951892d0 RDI: 000000000003a12f
[ 1432.088036] RBP: 0000000000000000 R08: ffffffffffffffb0 R09: 00007f8d95390570
[ 1432.088036] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000003a12f
[ 1432.088036] R13: 0000000000000000 R14: 0000000000000000 R15: 00007f8d951892d0
[ 1432.088036] FS:  00002b5b722b4b20(0000) GS:ffff88007fcc0000(0000) knlGS:00000000556e06c0
[ 1432.088036] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1432.088036] CR2: 0000000000000091 CR3: 0000000066d00000 CR4: 00000000000006e0
[ 1432.088036] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1432.088036] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1432.088036] Process modprobe (pid: 4864, threadinfo ffff88006b8d0000, task ffff88007aaa9750)
[ 1432.088036] Stack:
[ 1432.088036]  00007f8d95390570 ffffffffffffffb0 0000000000000001 0000000000000000
[ 1432.088036]  00007f8d951892d0 ffff88000003a12f 0000000200000001 ffff88007aa44030
[ 1432.088036]  0000000000000000 ffffffffa01e69be 0000000000000000 00000000000000d0
[ 1432.088036] Call Trace:
[ 1432.088036]  [<ffffffffa01e69be>] ? dtrace_systrace_syscall2+0xa5/0x231 [dtracedrv]
[ 1432.088036]  [<ffffffff810ebb4f>] ? kmem_cache_alloc+0x86/0xea
[ 1432.088036]  [<ffffffffa01e6cef>] ? dtrace_systrace_syscall+0xcf/0xd4 [dtracedrv]
[ 1432.088036]  [<ffffffff813497f5>] ? page_fault+0x25/0x30
[ 1432.088036]  [<ffffffff8134e212>] ? system_call_fastpath+0x16/0x1b
[ 1432.088036] Code: 44 24 08 4c 89 0c 24 e8 99 56 01 00 48 8b 80 c0 00 00 00 48 8b 54 24 18 48 8b 4c 24 10 48 8b 74 24 20 8b 7c 24 28 4c 8b 44 24 08 <f6> 80 91 00 00 00 02 4c 8b 0c 24 74 1c 83 3d 87 df 05 00 00 74 
[ 1432.088036] RIP  [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.088036]  RSP <ffff88006b8d1e80>
[ 1432.088036] CR2: 0000000000000091
[ 1432.088016] BUG: unable to handle kernel NULL pointer dereference at 0000000000000091
[ 1432.088016] IP: [<ffffffffa01cbccd>] dtrace_probe+0x5b/0x199 [dtracedrv]
[ 1432.088016] PGD 6b8c4067 PUD 66677067 PMD 0 
[ 1432.088016] Oops: 0000 [#7] SMP 
[ 1432.088016] CPU 2 
[ 1432.088016] Modules linked in: dtracedrv(P) loop snd_pcm snd_page_alloc snd_timer snd soundcore psmouse processor parport_pc thermal_sys evdev pcsp

Processor on the host is an AMD 6128. The guest is running with -smp 6
In the guest /proc/cpuinfo appears as:

processor   : 5
vendor_id   : AuthenticAMD
cpu family  : 15
model       : 6
model name  : AMD Opteron 23xx (Gen 3 Class Opteron)
stepping    : 1
microcode   : 0x1000065
cpu MHz     : 1999.999
cache size  : 512 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl extd_apicid pni cx16 popcnt hypervisor svm abm sse4a misalignsse
bogomips    : 3999.99
TLB size    : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

Variables of dtrace4linux support?

Dear:

I try define some data type for switching arg to args.

I get some variables support questions.

  1. Did dtrace4linux support enum? (I try and fail)
  2. Did dtrace4linux support uion? (I try and also fail)

I can confirm that dtrace4linux suppport struct and most datatype.
(Like unsigned int, unsigned long, char, int, struct ... and something definitions in header file that be loaded)

I think dtrace4linux will be the powerful and useful tools.

Just try to find some issues and if I can do anything helpful, please tell me.

I'll try it.

Thanks!!!

dtrace: double free or corruption

Here's a command:

sudo dtrace -n 'syscall:::entry' -c 'date'

Output on Mac OS X 10.6.8:

[last: 0] marca@SCML-MarcA:~/python/dtrace$ sudo dtrace -n 'syscall:::entry' -c 'date'
Sun Mar  4 08:37:50 PST 2012
dtrace: description 'syscall:::entry' matched 434 probes
dtrace: pid 37816 has exited
CPU     ID                    FUNCTION:NAME
  0  18987     __disable_threadsignal:entry 
  0  19047        bsdthread_terminate:entry 
  1  18433                      ioctl:entry 
  2  18433                      ioctl:entry 
  2  18433                      ioctl:entry 
  2  18729                   __sysctl:entry 
  2  18729                   __sysctl:entry 
  2  18417                  sigaction:entry 
  2  18417                  sigaction:entry 
  2  18417                  sigaction:entry 
  2  18417                  sigaction:entry 
  2  19119             write_nocancel:entry 
  2  19119             write_nocancel:entry 

Output on Ubuntu 11:

marca@ubuntu:~/src/tarcolor$ sudo dtrace -n 'syscall:::entry' -c 'date'
...
  0 311909              clock_gettime:entry 
  0 311721                       poll:entry 
  0 311909              clock_gettime:entry 
  0 311391                       read:entry 
  0 311391                       read:entry 
  0 311391                       read:entry 
  0 311909              clock_gettime:entry 
  0 311721                       poll:entry 
  0 311861                      futex:entry 
  0 311493                      ioctl:entry 

dt_proc_destroy flags=37748737
*** glibc detected *** dtrace: double free or corruption (out): 0x007b5438 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x6ebc2)[0x6aabc2]
/lib/i386-linux-gnu/libc.so.6(+0x6f862)[0x6ab862]
/lib/i386-linux-gnu/libc.so.6(cfree+0x6d)[0x6ae94d]
dtrace[0x80bba70]
dtrace[0x80bbace]
dtrace[0x80c0e72]
dtrace[0x80b4a40]
dtrace[0x80b5c89]
dtrace[0x809b0f5]
dtrace[0x809bca0]
dtrace[0x8081bf6]
dtrace[0x804fe4d]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x655113]
dtrace[0x804aed1]
======= Memory map: ========
00286000-00287000 r-xp 00000000 00:00 0          [vdso]
002dd000-002e0000 r-xp 00000000 08:01 3670960    /lib/i386-linux-gnu/libdl-2.13.so
002e0000-002e1000 r--p 00002000 08:01 3670960    /lib/i386-linux-gnu/libdl-2.13.so
002e1000-002e2000 rw-p 00003000 08:01 3670960    /lib/i386-linux-gnu/libdl-2.13.so
003aa000-003c1000 r-xp 00000000 08:01 3671009    /lib/i386-linux-gnu/libpthread-2.13.so

ctfconvert: die 45674: no attr 0xb

Make all fails on Ubuntu 12.04 64bit with this message.

Log:

date=Thu Aug 23 22:34:07 BST 2012
release=dtrace-20120823b
build=424
/home/dutow/dtrace-linux
Wed Sep 26 13:36:08 CEST 2012
$ uname -a:
Linux ubuntu 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"
$ cat /etc/motd
Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-generic x86_64)

$ cat build/port.h
/* This file is automatically generated via mkport.pl /
/
kern=/lib/modules/3.2.0-31-generic/build /
/
kern_src=/lib/modules/3.2.0-31-generic/build */

define FUNC_DUMP_TRACE_ARGS 6

define HAVE_ATOMIC_NOTIFIER_CHAIN_REGISTER 1

define HAVE_BX_REGISTER 1

define HAVE_CPLUS_DEMANGLE 1

define HAVE_CPU_NUMBER 1

define HAVE_ELF_C_READ_MMAP 1

define HAVE_INCLUDE_LINUX_CRED_H 1

define HAVE_INCLUDE_LINUX_HRTIMER_H 1

define HAVE_INCLUDE_LINUX_KDEBUG_H 1

define HAVE_INCLUDE_LINUX_MUTEX_H 1

define HAVE_INCLUDE_LINUX_SEMAPHORE_H 1

define HAVE_INCLUDE_LINUX_SLAB_H 1

define HAVE_LEX_YYTEXT_PTR 1

define HAVE_STACKTRACE_OPS

define HAVE_VMALLOC_SYNC_ALL 1

define SMP_CALL_FUNCTION_ARGS 3

define SMP_CALL_FUNCTION_SINGLE_ARGS 4

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
$ ld -v
GNU ld (GNU Binutils for Ubuntu) 2.22
flex 2.5.35
bison (GNU Bison) 2.5
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
processor : 0
model : 37
model name : Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz

BUILD_DIR=build-3.2.0-31-generic tools/build.pl build-3.2.0-31-generic uname -m
tools/check_dep.pl
tools/mkport.pl
tools/libgcc.pl
tools/mksyscall.pl
Processing (32): /lib/modules/3.2.0-31-generic/build/arch/x86/include/asm/unistd_32.h
Creating: build-3.2.0-31-generic/driver/syscalls-x86.tbl - 347 entries
Processing (64): /lib/modules/3.2.0-31-generic/build/arch/x86/include/asm/unistd_64.h
Creating: build-3.2.0-31-generic/driver/syscalls-x86-64.tbl - 312 entries
make all0
cd tests ; make --no-print-directory
case uname -m in
x86_64)
cc -m64 -g -o ../build-3.2.0-31-generic/sys64 syscalls.c ;
cc -m32 -g -o ../build-3.2.0-31-generic/sys32 syscalls.c ;
;;
i686)
cc -m32 -g -o ../build-3.2.0-31-generic/sys32 syscalls.c ;
;;
esac
cd libctf ; make --no-print-directory
cd libdtrace ; make --no-print-directory
cd liblinux ; make --no-print-directory
cd libproc/common ; make --no-print-directory
cd librtld ; make --no-print-directory
cd cmd/dtrace ; make --no-print-directory
cd cmd/ctfconvert ; make --no-print-directory
gcc -g -I. -I../../ -I../../libctf -I../../common -I../../uts/common -I../../linux -I/usr/include/libdwarf -o ../../build/ctfconvert ../../build/ctfconvert.obj/ctfconvert.o ../../build/ctfconvert.obj/alist.o ../../build/ctfconvert.obj/ctf.o ../../build/ctfconvert.obj/dwarf.o ../../build/ctfconvert.obj/hash.o ../../build/ctfconvert.obj/iidesc.o ../../build/ctfconvert.obj/input.o ../../build/ctfconvert.obj/list.o ../../build/ctfconvert.obj/memory.o ../../build/ctfconvert.obj/merge.o ../../build/ctfconvert.obj/output.o ../../build/ctfconvert.obj/st_bugs.o ../../build/ctfconvert.obj/st_parse.o ../../build/ctfconvert.obj/stabs.o ../../build/ctfconvert.obj/stack.o ../../build/ctfconvert.obj/strtab.o ../../build/ctfconvert.obj/symbol.o ../../build/ctfconvert.obj/tdata.o ../../build/ctfconvert.obj/traverse.o ../../build/ctfconvert.obj/util.o ../../build/libctf.a -ldwarf -lelf -lz
cd cmd/instr ; make --no-print-directory
cd usdt/c ; make --no-print-directory
tools/mkdriver.pl all
Executing: /home/dutow/dtrace-linux/tools/make-me
make -C /lib/modules/3.2.0-31-generic/build M=/home/dutow/dtrace-linux/build-3.2.0-31-generic/driver
CC [M] /home/dutow/dtrace-linux/build-3.2.0-31-generic/driver/systrace.o
LD [M] /home/dutow/dtrace-linux/build-3.2.0-31-generic/driver/dtracedrv.o
Building modules, stage 2.
MODPOST 1 modules
LD [M] /home/dutow/dtrace-linux/build-3.2.0-31-generic/driver/dtracedrv.ko
tools/mkctf.sh
ERROR: ctfconvert: die 45674: no attr 0xb
ls: cannot access build/linux-3.2.0-31-generic.ctf: No such file or directory
make[2]: *** [kernel] Error 2
tools/bug.sh
make[1]: *** [all] Error 1

Simple dtraces not working

Shouldn't this work?

marca@ubuntu:~/src/dtrace4linux/newlinux/tests$ sudo dtrace -n 'pid$target:::entry' -c '/bin/uname'
aux[0]: type=32
aux[1]: type=33
aux[2]: type=16
aux[3]: type=6
aux[4]: type=17
aux[5]: type=3
aux[6]: type=4
aux[7]: type=5
aux[8]: type=7
aux[9]: type=8
aux[10]: type=9
aux[11]: type=11
aux[12]: type=12
aux[13]: type=13
aux[14]: type=14
aux[15]: type=23
aux[16]: type=25
aux[17]: type=31
aux[18]: type=15
aux[19]: type=0
in Pupdate_maps (check for 64b maps!)
in Pupdate_maps (check: pr_mapname is big enough PRMAPSZ=64)
rd_new:rd_new
rd_loadobj_iter
proc-stub:rd_event_enable
proc-stub:rd_errstr err=26
Build symtab /usr/sbin/dtrace
found section .interp
found section .note.ABI-tag
found section .note.gnu.build-id
found section .hash
found section .gnu.hash
found section .dynsym
found section .dynstr
found section .gnu.version
found section .gnu.version_r
found section .rel.dyn
found section .rel.plt
found section .init
found section .plt
found section .text
found section .fini
found section .rodata
found section .eh_frame_hdr
found section .eh_frame
found section .ctors
found section .dtors
found section .jcr
found section .dynamic
found section .got
found section .got.plt
found section .data
found section .bss
found section .comment
found section .debug_aranges
found section .debug_pubnames
found section .debug_info
found section .debug_abbrev
found section .debug_line
found section .debug_frame
found section .debug_str
found section .debug_loc
found section .debug_ranges
found section .shstrtab
found section .symtab
found section .strtab
plt at 0x9ef5cd0
sym_by_name_binary: NOT found _PROCEDURE_LINKAGE_TABLE_
Pxlookup_by_name 'main' a.out 0x9ef5814 0x9ef4994
sym_by_name_binary: found main
dtrace: invalid probe specifier pid$target:::entry: "/usr/lib/dtrace/sched.d", line 60: no symbolic type information is available for kernel`dtrace_cpu_id: Invalid argument
dt_proc_destroy flags=37748737
User defined signal 1

32 bit issues

building on 32 bit ubuntu 12.04 complains about unavailable values at intr.c:694 and generates core dump at dt_module.c:992.

I am not an expert, but the below patch works for me.

The code seems to declare gate_t as gate64 or gate32, but this block uses gate64 fields which are not available on my 32 bit machine. If I patch
--- a/driver/intr.c
+++ b/driver/intr.c
@@ -694,10 +694,14 @@ dtrace_write_idt_entry2(int vec)

info[0].vector = vec;
info[0].address = gate_offset(*val);
  • // AN we do not have these for 32 bits
    +#ifndef __i386
    info[0].cs = gate_segment(*val);
    info[0].flags = val->dpl;
    if (val->type == GATE_INTERRUPT)
    info[0].flags |= 1 << 2;
    +#endif

It works.

I am also seeing coredumps from dt_module.c as dm_aslen seems to be 0, so when it enters the for loop, the first run with 0 gives problems, introducing a length check prevents this issue.

--- a/libdtrace/dt_module.c
+++ b/libdtrace/dt_module.c

@@ -992,9 +992,12 @@ asmap[i]->st_size);_/
}
} else {
Elf32_Sym *_asmap = dmp->dm_asmap;

  •   for (i = 0; i < dmp->dm_aslen-1; i++) {
    
  •    // AN no values for dmp->dm_aslen
    
  •    if (dmp->dm_aslen > 0) {
    
  •      for (i = 0; i < dmp->dm_aslen-1; i++) {
        asmap[i]->st_size = asmap[i+1]->st_value - asmap[i]->st_value;
    
  •   }
    
  •      }
    
  •    }
    

I am running with the latest code and the last commit was commit 21b5732

improve timestamp resolution

The timestamp variable returns time with a ~10 ms granularity (based on xtime cache). For performance analysis it needs much better resolution.

This looks like it is due to dtrace_gethrtime() in driver/dtrace_linux.c, which looks like a work in progress.

As a workaround, I've been making the following change:

diff --git a/driver/dtrace_linux.c b/driver/dtrace_linux.c
index ac13788..8bb2ed3 100644
--- a/driver/dtrace_linux.c
+++ b/driver/dtrace_linux.c
@@ -387,6 +387,9 @@ dtrace_gethrtime()
 {
        struct timespec ts;

+       getnstimeofday(&ts);
+       return (hrtime_t) ts.tv_sec * 1000 * 1000 * 1000 + ts.tv_nsec;
+
        /*
        void (*ktime_get_ts)() = get_proc_addr("ktime_get_ts");
        if (ktime_get_ts == NULL) return 0;

WARNING: getnstimeofday() grabs seqlock. I don't know if this is safe to do in DTrace context - I'd assume it isn't until known otherwise. Generally, grabbing locks in DTrace context is unsafe (blocking while interrupts disabled), however, the characteristics of seqlock sound similar to the behavior of the Solaris dtrace_gethrtime(), so this might be ok.

As some example output with the above change, showing the resolution is satisfactory:

root@ubuntu:~/linux# dtrace -n 'syscall:::entry { self->ts = timestamp; }
    syscall:::return /self->ts/ { @["ns"] = quantize(timestamp - self->ts); self->ts = 0; }'
dtrace: description 'syscall:::entry ' matched 1318 probes
^C

  ns                                                
           value  ------------- Distribution ------------- count    
             256 |                                         0        
             512 |@                                        250      
            1024 |@@@@@@@@@@@@@@@@@@                       2982     
            2048 |@@                                       424      
            4096 |@                                        106      
            8192 |@@@@@@@@@@@@@@@@@                        2815     
           16384 |@                                        127      
           32768 |                                         3        
           65536 |                                         6        
          131072 |                                         17       
          262144 |                                         0        
          524288 |                                         0        
[...]

KSWAPD_SKIP_CONGESTION_WAIT undeclared

I got this error while building on Arch Linux, kernel 3.9.9-1. I don't know too much about kernel programming, but I looked a little and I think KSWAPD_SKIP_CONGESTION_WAIT was removed in a recent patch: torvalds/linux@258401a .

/home/rendaw/software/dtrace4linux/build-3.9.9-1-ARCH/driver/vminfo.c: In function 'vminfo_init':
/home/rendaw/software/dtrace4linux/build-3.9.9-1-ARCH/driver/vminfo.c:136:32: error: 'KSWAPD_SKIP_CONGESTION_WAIT' undeclared (first use in this function)
  sdt_add_locator(vm_event_addr(KSWAPD_SKIP_CONGESTION_WAIT), "vminfo:::kswapd_skip_congestion_wait");
                                ^
/home/rendaw/software/dtrace4linux/build-3.9.9-1-ARCH/driver/vminfo.c:96:50: note: in definition of macro 'vm_event_addr'
 # define vm_event_addr(x) &vm_event_states.event[x]
                                                  ^
/home/rendaw/software/dtrace4linux/build-3.9.9-1-ARCH/driver/vminfo.c:136:32: note: each undeclared identifier is reported only once for each function it appears in
  sdt_add_locator(vm_event_addr(KSWAPD_SKIP_CONGESTION_WAIT), "vminfo:::kswapd_skip_congestion_wait");
                                ^
/home/rendaw/software/dtrace4linux/build-3.9.9-1-ARCH/driver/vminfo.c:96:50: note: in definition of macro 'vm_event_addr'
 # define vm_event_addr(x) &vm_event_states.event[x]
                                                  ^

Compile error - 'pmd_t' has no member named 'pmd'

This is on an Ubuntu 11.10 (Oneiric) 32-bit system. Here's the kernel config:

https://gist.github.com/3058026

$ uname -a
Linux oneiric32 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 i686 i686 i386 GNU/Linux
vagrant@oneiric32:~/dtrace4linux$ cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 42
model name  : Intel(R) Core(TM) i5-2435M CPU @ 2.40GHz
stepping    : 7
cpu MHz     : 2397.986
cache size  : 6144 KB
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 5
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm constant_tsc up pni monitor ssse3 lahf_lm
bogomips    : 4795.97
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

It built fine after I did this hack:

--- a/driver/dtrace_linux.c
+++ b/driver/dtrace_linux.c
@@ -1304,14 +1304,14 @@ mem_set_writable(unsigned long addr, page_perms_t *pp, int perms)
        /*   Avoid  touching/flushing  page  table if  */
        /*   this is a no-op.                          */
        /***********************************************/
-# if defined(__i386) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 4)
+# if 1
        perms1 = pmd->pud.pgd.pgd;
 # else
        perms1 = pmd->pmd;
 # endif
        if ((perms1 & perms) != perms ||
            (pte->pte & (perms | _PAGE_NX)) != perms) {
-# if defined(__i386) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 4)
+# if 1
                pmd->pud.pgd.pgd |= perms;
 # else
                pmd->pmd |= perms;

stack() causes kernel panic

Is anyone having any success, on any version of Linux, with the DTrace "stack()" function?
This should record a kernel stack trace.
But any time I have been brave enough to try, I always get a kernel panic :-(

dtrace requires multilib support

I tried building dtrace on a system that has no multilib support. It failed to build:

# make -j7 all
BUILD_DIR=build-3.4.2-hardened tools/build.pl build-3.4.2-hardened `uname -m`
tools/check_dep.pl
tools/mkport.pl
tools/libgcc.pl
tools/mksyscall.pl
Processing (32): /lib/modules/3.4.2-hardened/build/arch/x86/include/generated/asm/unistd_32.h
Creating: build-3.4.2-hardened/driver/syscalls-x86.tbl - 345 entries
Processing (64): /lib/modules/3.4.2-hardened/build/arch/x86/include/generated/asm/unistd_64.h
Creating: build-3.4.2-hardened/driver/syscalls-x86-64.tbl - 312 entries
make all0
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
cd tests ; make --no-print-directory
case `uname -m` in \
  x86_64) \
        cc -m64 -g -o ../build-3.4.2-hardened/sys64 syscalls.c ; \
        cc -m32 -g -o ../build-3.4.2-hardened/sys32 syscalls.c ; \
        ;; \
  i686) \
        cc -m32 -g -o ../build-3.4.2-hardened/sys32 syscalls.c ; \
        ;; \
esac
In file included from /usr/include/features.h:382:0,
                 from /usr/include/stdio.h:28,
                 from syscalls.c:7:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
compilation terminated.
make[2]: *** [all] Error 1
make[1]: *** [do_cmds] Error 2
tools/bug.sh
make: *** [all] Error 1

'make install' fails if 'linux*.ctf' is missing

Libdwarf/ctf isn't mandatory if you are just tracing or probing functions.
It's only needed for structure members/pointers.

But currently if 'linux*.ctf' is missing, then 'make install' fails:

install: cannot stat `build/linux_.ctf': No such file or directory
make: *_* [install] Error 1

The work around is to comment out the following line in the makefile:

install -m 644 -o root build/linux*.ctf "$(DESTDIR)"/usr/lib/dtrace

dtrace -P syscall results in infinite loop

marca@ubuntu:~/src/dtrace4linux/newlinux/tests$ sudo dtrace -P syscall | wc -l
dtrace: description 'syscall' matched 668 probes
^Cmarca@ubuntu:~/src/dtrace4linux/newlinux/tests$ date; sudo dtrace -P syscall | wc -l
Fri Mar  2 09:58:59 PST 2012
dtrace: description 'syscall' matched 668 probes
^C
marca@ubuntu:~/src/dtrace4linux/newlinux/tests$ date
Fri Mar  2 09:59:40 PST 2012
### Notice that almost a minute went by... ###
marca@ubuntu:~/src/dtrace4linux/newlinux/tests$ date; sudo dtrace -P syscall | grep 276348
Fri Mar  2 09:59:59 PST 2012
dtrace: description 'syscall' matched 668 probes
  0 276348                     write:return 
  0 276348                     write:return 
  0 276348                     write:return 
  0 276348                     write:return 
  0 276348                     write:return 
  0 276348                     write:return 
  0 276348                     write:return 
  0 276348                     write:return 
  0 276348                     write:return 
### Notice that it's repeating probes... ###

Does dtrace4linux support USDT probes?

I ask because I've been trying to see if I can get a patch to add USDT probes to Python (http://bugs.python.org/issue13405) working with dtrace4linux.

I can get Python to build with this patch, but so far I haven't had success getting it to recognize the probes.

marca@ubuntu:~/src/python-dtrace/cpython-2011$ cat track.d
unsigned long int tam;
unsigned int num;

pid$target::PyCode_New:entry
{
    self->flag=1;
}

pid$target::PyCode_New:return
{
    self->flag=0;
}

pid$target::PyMem_Malloc:entry
/self->flag/
{
    self->tam=arg0;
    tam+=arg0;
    num+=1;
    printf("%d %d", num, tam);
}

pid$target::PyMem_Malloc:return
/self->flag/
{
    pos[arg1]=self->tam;
    self->tam=0;
}

pid$target::PyMem_Free:entry
/pos[arg0]/
{
    num-=1;
    tam-=pos[arg0];
    pos[arg0]=0;
}

marca@ubuntu:~/src/python-dtrace/cpython-2011$ sudo dtrace -s track.d -c "/Users/marca/custom/bin/pydoc foo"
...

found section .shstrtab
found section .symtab
found section .strtab
plt at 0x9e29938
sym_by_name_binary: NOT found _PROCEDURE_LINKAGE_TABLE_
Pxlookup_by_name 'main' a.out 0x9e2935c 0x9e28550
sym_by_name_binary: found main
dtrace: failed to compile script track.d: line 4: probe description pid2780::PyCode_New:entry does not match any probes
dt_proc_destroy flags=37748737

If USDT probes aren't supported yet, then I won't spend more time on this, but if they are supposed to work, then I might take a look at the patch itself and see if it needs fixes.

By the way, here's the output of the command I showed using a patched Python on OS X:

[last: 0] marca@SCML-MarcA:~/python/dtrace$ sudo dtrace -s track.d -c "/Users/marca/custom/bin/pydoc foo"
dtrace: script 'track.d' matched 5 probes
no Python documentation found for 'foo'

dtrace: pid 38014 has exited
CPU     ID                    FUNCTION:NAME
  0 146268               PyMem_Malloc:entry 35 19604
  0 146268               PyMem_Malloc:entry 36 19788
  0 146268               PyMem_Malloc:entry 37 19916
  0 146268               PyMem_Malloc:entry 38 20062
  0 146268               PyMem_Malloc:entry 39 20208
  0 146268               PyMem_Malloc:entry 40 20378

Simple User script example

Hi,
I created a repository here: https://github.com/schmurfy/dtrace_test
with the minimal set required to build an application with probes and the Dtrace script using this probe, this was teste and works well under Mac OSX but I have no idea how to make it run under Linux with Dtrace, could you help me add the missing pieces ?

By looking at what you do to build the usdt/c example I am definitely sure I am missing something but I cannot make any sense of what is in this makefile :s

NULL pointer dereference after running dtrace script (linux 3.10)

Trying to run dtrace on PID, using dtrace script, and when function that I've trace entered/leaved get next error in kern.log, and after this PID is killed by: "Trace/breakpoint trap"

Don't pay attention to 2-6-39 it is just host name.

And also this one is after applying #60
But I don't event try to read /proc/dtrace/*, so that patchset mustn't affect this bug.
And BTW I have the same issue as in #58 when compiling (maybe this can affect)

Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.067716] CPU: 0 PID: 3110 Comm: boostcached Tainted: P        W  O 3.11.0-rc1+ #21
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.069988] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  0000000000000000 ffff8800370d9460 ffffffff813689a2 ffff8800370d9460
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  ffffffffa0353dc4 ffff8800370d9460 ffff8800370d9460 ffff88007fc09f58
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  0000000000000000 ffffffffa039be20 ffffffffa039be78 ffffffffa034a5ca
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  ffffffffa0353dc4 ffff8800370d9460 ffff8800370d9460 ffff88007fc09f58                                                                                                              [0/160]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  0000000000000000 ffffffffa039be20 ffffffffa039be78 ffffffffa034a5ca
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585] Call Trace:
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  <#DB>  [<ffffffff813689a2>] ? dump_stack+0x41/0x51
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  [<ffffffffa0353dc4>] ? mutex_enter_common+0x29/0xd7 [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  [<ffffffffa034a5ca>] ? rw_enter+0x10/0x4b [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  [<ffffffffa034af6e>] ? dtrace_user_probe+0x198/0x2a6 [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  [<ffffffffa0352c89>] ? dtrace_int3_handler+0x111/0x201 [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  [<ffffffffa03534cd>] ? dtrace_int3+0x3a/0x8f [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.071585]  <<EOE>> 
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.092483] traps: boostcached[3110] trap int3 ip:4fc157 sp:7f9b14081758 error:0
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.094567] BUG: unable to handle kernel NULL pointer dereference at           (null)
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098015] IP: [<          (null)>]           (null)
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] PGD 36d59067 PUD 7cadf067 PMD 0 
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] Oops: 0010 [#1] SMP 
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] Modules linked in: dtracedrv(PO) nfsd auth_rpcgss oid_registry nfs_acl nfs lockd fscache sunrpc loop fuse joydev hid_generic usbhid hid snd_pcm mperf snd_page_alloc snd_timer snd soundc
ore button processor psmouse thermal_sys pcspkr serio_raw ohci_pci ohci_hcd ehci_hcd usbcore microcode usb_common parport_pc i2c_piix4 parport i2c_core ac evdev ext4 crc16 jbd2 mbcache sg sr_mod cdrom sd_mod crc_t10dif ata_generic ata_piix ahci l
ibahci libata scsi_mod e1000
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] CPU: 1 PID: 3108 Comm: boostcached Tainted: P        W  O 3.11.0-rc1+ #21
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] task: ffff880037200180 ti: ffff880036c32000 task.ti: ffff880036c32000
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] RIP: 0010:[<0000000000000000>]  [<          (null)>]           (null)
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] RSP: 0018:ffff880036c33ad8  EFLAGS: 00010246
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] RAX: ffffffff8104beca RBX: ffff88007b557780 RCX: 0000000000000000
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] RDX: 0000000000000001 RSI: ffff88007b557780 RDI: ffff8800370e0400
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] RBP: ffff8800370e0400 R08: 00000000000000c0 R09: 0000000000000030
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] R10: 0000000000000020 R11: 0000000000000020 R12: 0000000000000001
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] R13: 0000000000000000 R14: ffffffffa034c971 R15: ffff880037200180
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] FS:  00007f9b169f9740(0000) GS:ffff88007fd00000(0000) knlGS:0000000000000000
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] CR2: 0000000000000000 CR3: 000000007abe0000 CR4: 00000000000006e0
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] Stack:
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  ffffffffa0358a0e ffffffffa034c971 0000000000000000 ffff880037200180
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  0000000000000000 0000000000000009 ffffffffa0358a9a 0000000000000001
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  ffff880036c33bc8 ffff880036c33b50 ffffffffa034c95e ffffffffa034cd78
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] Call Trace:
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffffa0358a0e>] ? taskq_dispatch2+0xb4/0xc0 [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffffa034c971>] ? fasttrap_pid_cleanup+0x78/0x78 [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffffa0358a9a>] ? timeout+0x41/0x86 [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffffa034c95e>] ? fasttrap_pid_cleanup+0x65/0x78 [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffffa034cd78>] ? fasttrap_exec_exit+0x22/0x2c [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffffa0349003>] ? proc_exit_notifier+0x57/0x6e [dtracedrv]
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff8136f9ad>] ? notifier_call_chain+0x2e/0x59
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff8105ab12>] ? should_resched+0x5/0x23
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff81055f83>] ? __blocking_notifier_call_chain+0x43/0x5d
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff8103a6d4>] ? do_exit+0x22/0x8ff
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff8103b0ba>] ? do_group_exit+0x67/0x99
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff810461e8>] ? get_signal_to_deliver+0x479/0x4ad
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff810da509>] ? sync_mm_rss+0x35/0x5f
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff8100209b>] ? do_signal+0x3c/0x434
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff81058874>] ? task_rq_unlock+0xf/0x23
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff8105d4ca>] ? wake_up_new_task+0xb7/0xd0
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff81079599>] ? SyS_futex+0x12e/0x161
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff810024b8>] ? do_notify_resume+0x25/0x68
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  [<ffffffff81371dda>] ? int_signal+0x12/0x17
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] Code:  Bad RIP value.
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] RIP  [<          (null)>]           (null)
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512]  RSP <ffff880036c33ad8>
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.098512] CR2: 0000000000000000
Jul 21 12:56:02 debian-virtual-2-6-39 kernel: [  103.155460] ---[ end trace 0282fba058bae4eb ]---

Dtrace xcall issue? (dtrace_xcall)

Because of the above issue, I try to trace some log about loading module.

When I execute the "make load" command

root@nova-network:~/dtrace4linux-linux-9cfcba5# make load
tools/load.pl
00:52:37 Syncing...
00:52:37 Loading: build-3.1.10-st0315-1/driver/dtracedrv.ko
00:52:39 Preparing symbols...
00:52:39 Probes available: 282125
00:52:42 Time: 5s

and I got logs as following:
https://gist.github.com/2349857

Is it a bug? I found some xcall issue posts from CRiSP Weblog.

I can not understand clearly. That warning will effect the module loading?

If more details or action needed from me, let me know please. Thanks!!

Sincerely

Vicente

Failed compilation on Fedora 16 64-bit - dtrace-20120311

Hi,

Just wanted to report a compilation failure on the latest Fedora 16 using the latest dtrace4linux/linux release.

An earlier version of dtrace4linux/linux could be compiled on January's version of Fedora 16 (if I remember correctly; it was a 2.6.x kernel; instead of 3.x).

[leow@belinda dtrace-20120311]$ uname -a
Linux belinda 3.3.1-2.fc16.x86_64 #1 SMP Tue Apr 3 00:46:10 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

release=dtrace-20120311
build=379

Full log details at:
https://gist.github.com/2319726

Let me know if more details needed or if any action needed from my end. Thanks!

Cheers!
Michael Leow

If mkerrtags.sh fails, it should remove dt_errtags.c

$ make all
...

mkerrtags.sh <dt_errtags.h > dt_errtags.c
/bin/sh: mkerrtags.sh: not found
make[2]: *** [dt_errtags.c] Error 127
rm dt_decl.o dt_dof.o dt_cc.o dt_cg.o dt_consume.o dt_buf.o dt_as.o dt_aggregate.o dt_error.o dt_dis.o
make[1]: *** [do_cmds] Error 2
tools/bug.sh
make: *** [all] Error 1
marca@ubuntu:~/src/dtrace4linux/linux$ ls -l libdtrace/dt_errtags.c
-rw-r--r-- 1 marca marca 0 2012-02-29 11:33 libdtrace/dt_errtags.c

As a result, if you try to build again, it will skip this step and give a different error which is very confusing:

$ make all
...

cc -g -W -D_ILP32 -D_LONGLONG_TYPE -o ../../build-2.6.32-38-generic/dtrace -L../../build-2.6.32-38-generic ../../build-2.6.32-38-generic/dtrace.o -ldtrace -lctf -lproc -llinux -lz -lrt -lpthread -lelf -ldl
../../build-2.6.32-38-generic/libdtrace.a(dt_cc.o): In function `dt_load_libs_dir':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_cc.c:2228: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_cc.o): In function `dt_load_libs_sort':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_cc.c:2284: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_parser.o): In function `dt_cook_clause':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4082: undefined reference to `dt_errtag'
/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4083: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_parser.o): In function `xyvwarn':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4829: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_parser.o):/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4863: more undefined references to `dt_errtag' follow
../../build-2.6.32-38-generic/libdtrace.a(dt_dis.o): In function `dt_dis_call':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_dis.c:204: undefined reference to `dtrace_subrstr'
collect2: ld returned 1 exit status
make[2]: *** [../../build-2.6.32-38-generic/dtrace] Error 1
make[1]: *** [do_cmds] Error 2
tools/bug.sh
make: *** [all] Error 1

failed to resolve curpsinfo

I'm new to DTrace and found this really easy to install, but just a basic test probe isn't working

$ sudo dtrace -n BEGIN
dtrace: invalid probe specifier BEGIN: "/usr/lib/dtrace/node.d", line 56: failed to resolve curpsinfo: Unknown variable name

Running Ubuntu 13.04 with kernel version 3.8.0-27. Any help appreciated :)

Kernel oops and 100% CPU usage on fbt:isofs:: probes

dtrace: commit d663d2d, Sat Aug 18 16:24:10 2012 +0100
uname -a: Linux debian-testing-vm 3.2.0-3-amd64 #1 SMP Mon Jul 23 02:45:17 UTC 2012 x86_64 GNU/Linux

I am currently trying out dtrace in my Debian virtual machine (Debian Wheezy/Testing) via Virtualbox in order to probe anything that goes on in the isofs kernel module (trying to find out more about a hang).

After loading the module (sudo modprobe -v isofs) I run the following trivial script (my first):

#!/usr/sbin/dtrace -s


/* Intercepting all isofs function entries and exits */
fbt:isofs::
{
        trace("worked!");
        exit(0);
        /*printf("%s %s", probefunc, probename);*/
}

Originally I had the normal printf line, but thats commented out to test this in general. When the above script is ran, the following kernel oops happens:

Aug 19 19:44:36 debian-testing-vm kernel: [  146.857394] dtracedrv: module license 'CDDL' taints kernel.
Aug 19 19:44:36 debian-testing-vm kernel: [  146.857402] Disabling lock debugging due to kernel taint
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883607] Pid: 3198, comm: insmod Tainted: P           O 3.2.0-3-amd64 #1
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883614] Call Trace:
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883689]  [<ffffffffa052e001>] ? mutex_enter_common+0x27/0xcb [dtracedrv]
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883758]  [<ffffffffa0524807>] ? par_alloc+0x1f/0xc6 [dtracedrv]
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883798]  [<ffffffffa052b473>] ? fbt_provide_module+0x34/0x23e [dtracedrv]
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883808]  [<ffffffff8124d0e2>] ? device_create_vargs+0x86/0xbe
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883816]  [<ffffffff81036457>] ? should_resched+0x5/0x23
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883825]  [<ffffffff813499cf>] ? _cond_resched+0x7/0x1c
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883830]  [<ffffffff81036457>] ? should_resched+0x5/0x23
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883836]  [<ffffffff813499cf>] ? _cond_resched+0x7/0x1c
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883842]  [<ffffffff8134a1b0>] ? mutex_lock+0xd/0x2d
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883883]  [<ffffffffa050c86e>] ? dtrace_module_loaded+0x92/0x10d [dtracedrv]
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883891]  [<ffffffff8134dcd6>] ? notifier_call_chain+0x2e/0x5b
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883897]  [<ffffffff81036457>] ? should_resched+0x5/0x23
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883904]  [<ffffffff81063261>] ? __blocking_notifier_call_chain+0x48/0x5e
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883912]  [<ffffffff81074f6e>] ? sys_init_module+0x1b6/0x25b
Aug 19 19:44:36 debian-testing-vm kernel: [  146.883919]  [<ffffffff8134fc92>] ? system_call_fastpath+0x16/0x1b
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880448] BUG: unable to handle kernel paging request at ffffffffa0182086
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880453] IP: [<ffffffffa052b91a>] fbt_enable+0x5b/0x6a [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880464] PGD 1607067 PUD 160b063 PMD 3745b067 PTE 0
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880468] Oops: 0002 [#1] SMP 
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880470] CPU 0 
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880471] Modules linked in: isofs dtracedrv(P) vboxsf(O) pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) mperf cpufreq_stats cpufreq_conservative cpufreq_userspace cpufreq_powers
ave ppdev lp vboxvideo(O) drm rfcomm bnep bluetooth rfkill binfmt_misc fuse vhba(O) loop joydev i2c_piix4 snd_intel8x0 snd_ac97_codec snd_pcm snd_page_alloc snd_seq snd_seq_device snd_timer snd soundcore i2c_core ac97_bus parport_pc psmo
use ac serio_raw power_supply parport button processor evdev thermal_sys pcspkr vboxguest(O) ext4 crc16 jbd2 mbcache usbhid hid sd_mod crc_t10dif sr_mod cdrom ata_generic ata_piix ahci libahci ohci_hcd ehci_hcd e1000 libata usbcore scsi_
mod usb_common [last unloaded: scsi_wait_scan]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880507] 
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880509] Pid: 3225, comm: isofs_tracing.d Tainted: P           O 3.2.0-3-amd64 #1 innotek GmbH VirtualBox
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880512] RIP: 0010:[<ffffffffa052b91a>]  [<ffffffffa052b91a>] fbt_enable+0x5b/0x6a [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880520] RSP: 0018:ffff88003c965898  EFLAGS: 00010202
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880522] RAX: ffffffffa0182086 RBX: ffff88001e0c97c0 RCX: 0000000000000002
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880524] RDX: 7fffffffffffffcc RSI: ffff88003c965848 RDI: 000000003745b067
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880525] RBP: ffff88001e0c9740 R08: ffff880000000c18 R09: ffff88000160b800
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880526] R10: ffff88001e118ff8 R11: 0000000000000000 R12: ffff88003744ffc0
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880528] R13: 0000000000000000 R14: ffff88001e091600 R15: ffffffffa05194e1
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880536] FS:  00007fd4d9c4b700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880538] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880539] CR2: ffffffffa0182086 CR3: 000000001e118000 CR4: 00000000000006f0
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880543] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880545] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880546] Process isofs_tracing.d (pid: 3225, threadinfo ffff88003c964000, task ffff88003cede180)
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880548] Stack:
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880549]  ffff88001bfffd40 ffffffffa051b02d ffff88001e018200 0000000000000007
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880552]  ffff880000000006 ffff88001e0e66c0 ffff88001e0182c0 ffffffffa050c0da
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880555]  0000000000000006 ffff88003c9659f0 0000000000000007 ffff8800265bc300
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880557] Call Trace:
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880564]  [<ffffffffa051b02d>] ? dtrace_ecb_create_enable+0x1b4c/0x1be0 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880574]  [<ffffffffa050c0da>] ? dtrace_match_probe+0x8c/0xa6 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880579]  [<ffffffffa05194e1>] ? dtrace_ecb_destroy+0x555/0x555 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880585]  [<ffffffffa050c2ec>] ? dtrace_match+0x1f8/0x226 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880590]  [<ffffffff810eb6e5>] ? __kmalloc+0x100/0x112
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880596]  [<ffffffffa052456b>] ? kmem_zalloc+0x2e/0x54 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880602]  [<ffffffffa051b231>] ? dtrace_probe_enable+0x170/0x177 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880608]  [<ffffffffa050e34f>] ? dtrace_strcmp+0x1b/0x1b [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880613]  [<ffffffffa050e34f>] ? dtrace_strcmp+0x1b/0x1b [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880618]  [<ffffffffa0508f03>] ? dtrace_match_glob+0x199/0x199 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880623]  [<ffffffffa0508f03>] ? dtrace_match_glob+0x199/0x199 [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880628]  [<ffffffffa051b372>] ? dtrace_enabling_match+0x13a/0x1ca [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880634]  [<ffffffffa0520fe5>] ? dtrace_ioctl+0xc3e/0x217a [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880637]  [<ffffffff810cd779>] ? pte_offset_kernel+0x16/0x35
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880644]  [<ffffffff810c926a>] ? zone_page_state_add+0x14/0x23
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880647]  [<ffffffff810c9ec0>] ? __inc_zone_state+0x41/0x49
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880650]  [<ffffffff810ca0dd>] ? zone_statistics+0x41/0x74
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880653]  [<ffffffff810ba446>] ? get_page_from_freelist+0x57a/0x665
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880656]  [<ffffffff810bad51>] ? __alloc_pages_nodemask+0x6bf/0x726
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880659]  [<ffffffff810b3c44>] ? find_get_page+0x40/0x63
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880661]  [<ffffffff81036457>] ? should_resched+0x5/0x23
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880665]  [<ffffffff813499cf>] ? _cond_resched+0x7/0x1c
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880668]  [<ffffffff810b5aa8>] ? filemap_fault+0x1e6/0x33e
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880671]  [<ffffffff810f5ef5>] ? lookup_page_cgroup+0x2d/0x42
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880673]  [<ffffffff810f18d1>] ? mem_cgroup_update_page_stat+0x17/0xd4
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880676]  [<ffffffff810cdecd>] ? __do_fault+0x371/0x3ac
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880678]  [<ffffffff810d019f>] ? handle_pte_fault+0x298/0x79f
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880680]  [<ffffffff810cd779>] ? pte_offset_kernel+0x16/0x35
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880687]  [<ffffffffa0523c2e>] ? dtracedrv_ioctl.isra.3+0x3c/0x4d [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880693]  [<ffffffffa0523c4f>] ? dtracedrv_unlocked_ioctl+0x6/0xa [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880697]  [<ffffffff81106911>] ? do_vfs_ioctl+0x459/0x49a
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880699]  [<ffffffff81036457>] ? should_resched+0x5/0x23
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880702]  [<ffffffff810d3612>] ? remove_vma+0x64/0x6b
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880704]  [<ffffffff810d47c7>] ? do_munmap+0x2da/0x2f3
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880706]  [<ffffffff8110699d>] ? sys_ioctl+0x4b/0x72
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880710]  [<ffffffff8134fc92>] ? system_call_fastpath+0x16/0x1b
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880714] Code: 54 a0 48 8b 73 08 31 c0 e8 ff 92 00 00 48 8b 7b 08 ba 01 00 00 00 be 01 00 00 00 e8 8e 8e ff ff 85 c0 74 09 48 8b 43 08 8a 53 12 <88> 10 48 8b 5b 48 48 85 db 75 b0 31 c0 5b c3 41 56 41 89 d6 41 
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880737] RIP  [<ffffffffa052b91a>] fbt_enable+0x5b/0x6a [dtracedrv]
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880744]  RSP <ffff88003c965898>
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880745] CR2: ffffffffa0182086
Aug 19 19:44:56 debian-testing-vm kernel: [  166.880747] ---[ end trace b484dd282d33d09e ]---

Something (no process name) then uses 100% kernel mode time on one CPU, and dtrace ignores SIGINT - time to reboot.

dtrace -n syscall::: results in infinite loop

I try these commands

dtrace -n syscall:::
dtrace -n syscall:x64::

Both commands results in infinite loop

root@nova-network:~# dtrace -n syscall:::
...
  0 280817                       read:entry
  0 280818                      read:return
  0 280863                     select:entry
  0 280864                    select:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280817                       read:entry
  0 280818                      read:return
  0 280863                     select:entry
  0 280864                    select:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280817                       read:entry
  0 280818                      read:return
  0 280863                     select:entry
  0 280864                    select:return
  0 280845             rt_sigprocmask:entry
^C
root@nova-network:~# dtrace -n syscall:x64::
...
  0 280817                       read:entry
  0 280818                      read:return
  0 280863                     select:entry
  0 280864                    select:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280817                       read:entry
  0 280818                      read:return
  0 280863                     select:entry
  0 280864                    select:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280845             rt_sigprocmask:entry
  0 280846            rt_sigprocmask:return
  0 280817                       read:entry
  0 280818                      read:return
  0 280863                     select:entry
^C
root@nova-network:~/dtrace4linux-linux-9cfcba5# uname -a
Linux nova-network 3.1.10-st0315-1 #2 SMP Thu Mar 15 20:08:51 CST 2012 x86_64 x86_64 x86_64 GNU/Linux
root@nova-network:~/dtrace4linux-linux-9cfcba5# cat .release
date=Mon Apr  9 16:02:58 BST 2012
release=dtrace-20120409
build=380

Linux 3.8: CONFIG_UIDGID_STRICT_TYPE_CHECKS breaks the build

I encountered the following failure when building against Linux 3.10.4. This issue first started in Linux 3.8.0, but generally only affects kernels built with user namespace support because it requires CONFIG_UIDGID_STRICT_TYPE_CHECKS:

/root/dtrace4linux/build-3.10.4/driver/ctl.c: In function 'ctl_linux_ioctl':
/root/dtrace4linux/build-3.10.4/driver/ctl.c:263:9: error: incompatible types when assigning to type 'uid_t' from type 'kuid_t'
    uid2 = child->cred->uid;
         ^
/root/dtrace4linux/build-3.10.4/driver/ctl.c:275:8: error: incompatible types when assigning to type 'uid_t' from type 'kuid_t'
   uid1 = current->cred->uid;
        ^

This also affected ZFSOnLinux. I wrote a fix for ZFSOnLinux's Solaris Porting Layer, which is currently in openzfs/spl#260. I imagine that a similar fix could be done in dtrace4linux.

If you adapt that patch, do not worry about licensing. You can have it under the CDDL.

missing kernel symbols, eg, struct sock

I had this script (tcpretransmit.d) working a while ago on Fedora:

#!/usr/sbin/dtrace -s

#pragma D option quiet

dtrace:::BEGIN { trace("Tracing TCP retransmits... Ctrl-C to end.\n"); }

fbt::tcp_retransmit_skb:entry {
    this->so = (struct sock *)arg0;
    this->d = (unsigned char *)&this->so->__sk_common.skc_daddr;
    printf("%Y: retransmit to %d.%d.%d.%d, by:", walltimestamp,
        this->d[0], this->d[1], this->d[2], this->d[3]);
    stack(99);
}

On Ubuntu 12.04 (3.5 kernel) I get:

root@ubuntu:~/linux# ~/tcpretransmit.d 
dtrace: failed to compile script /home/brendan/tcpretransmit.d: line 9: operator -> cannot be applied to a forward declaration: no struct sock definition is available

I tried adding struct sock to driver/ctf_struct.c, but couldn't get it to work.

I didn't have this problem before, so maybe something isn't getting built properly. The ctf file looks small:

-rw-r--r-- 1 root root 112848 May 28 15:23 build/linux-3.5.0-23-generic.ctf

Miss some modules of fbt probe (update)

I install dtrace4linux successfully.
(no error messages when make all, make install and make load)

I try some dtrace command (like dtrace -ln 'fbt:::entry') and it works correctly.

But it miss some modules of fbt probe.

I install ZFSonlinux but there is not any zfs module loaded into dtrace.
I can see the functions related zfs in /proc/kallsyms but it does not be loaded into dtrace.
In fact, my dtrace fbt probe only have kernel modules.

"# dtrace -l -P fbt | awk '{print $3}' | sort | uniq -c | sort -n
1 MODULE
52396 kernel

Is that right? (It look like can not load any modules of fbt probe)

my linux kernel:3.1.10, ZFSonlinux version:0.6.0-rc, dtrace4linux is the version in github.

root@nova-network:~/dtrace4linux-linux-9cfcba5# uname -a
Linux nova-network 3.1.10-st0315-1 SMP Thu Mar 15 20:08:51 CST 2012 x86_64 x86_64 x86_64 GNU/Linux

root@nova-network:~/dtrace4linux-linux-9cfcba5# cat .release
date=Mon Apr 9 16:02:58 BST 2012
release=dtrace-20120409
build=380

There is the kern.log when make load
https://gist.github.com/2349857

Thanks for answering!

_dtrace_defcpp needs to be changed

in libdtrace/dt_open.c the default Solaris cpp is used:

const char *_dtrace_defcpp = "/usr/ccs/lib/cpp"; /* default cpp(1) to invoke */

which should be changed to the Linux path for cpp (or gcc -E)

Build error: No rule to make target driver/uncompress.o

$ make all
...
tools/mkdriver.pl all
Executing: /home/marca/src/dtrace4linux/newlinux/tools/make-me
make -C /lib/modules/2.6.32-38-generic/build M=/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver
  CC [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/systrace.o
make[3]: *** No rule to make target `/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/uncompress.o', needed by `/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.o'.  Stop.
make[2]: *** [_module_/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver] Error 2
make[1]: *** [kernel] Error 2
tools/bug.sh
make: *** [all] Error 1

marca@ubuntu:~/src/dtrace4linux/newlinux$ git show-ref HEAD
30fc39c841852390bb8e3f66df3e5d9ad61d1b87 refs/remotes/origin/HEAD
marca@ubuntu:~/src/dtrace4linux/newlinux$ uname -a
Linux ubuntu 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012 i686 GNU/Linux

Random Segfault when tracing commands.

Tried tracing the ls command with the following one-liner:

dtrace -c 'ls' -n 'syscall:::entry /pid == $target/ {@[probefunc] = count();}'

the output was the following:

$ dtrace -c 'ls' -n 'syscall:::entry /pid == $target/ {@[probefunc] = count();}'
parent: waiting for child
parent: after waitpid pid=3719 status=137f
Segmentation fault

I run Ubuntu 12.04 LTS and I wanted to try a couple of examples from the dtrace book.
I don't know if that helps at all but I used gdb to see where the segfault came from and got this:

Starting program: /usr/sbin/dtrace -c 'ls' -n 'syscall:::entry /pid == $target/ {@[probefunc] = count();}'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
parent: waiting for child
child 3420 about to exec ls
parent: after waitpid pid=3420 status=57f
[New Thread 0x7f73a7b75700 (LWP 3421)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f73a7b75700 (LWP 3421)]
0x0000000000462ce2 in rd_loadobj_iter (rap=0xffffffffa0001da0, cb=0x47dc2f ><map_iter>, client_data=0x1719820) at rtld_db.c:196
196 snprintf(buf, sizeof buf, "/proc/%d/maps", rap->rd_pid);

It seems like the address of the 'rap' argument passed to the function is invalid. Hope I am not duplicating an issue here.

dt_dis.c:204: undefined reference to `dtrace_subrstr'

This is on Ubuntu 10.04.4:

$ make all
...
cd cmd/dtrace ; make --no-print-directory
cc -g -W -D_ILP32 -D_LONGLONG_TYPE -o ../../build-2.6.32-38-generic/dtrace -L../../build-2.6.32-38-generic ../../build-2.6.32-38-generic/dtrace.o -ldtrace -lctf -lproc -llinux -lz -lrt -lpthread -lelf -ldl
../../build-2.6.32-38-generic/libdtrace.a(dt_dis.o): In function `dt_dis_call':
/home/marca/src/dtrace4linux/newlinux/libdtrace/dt_dis.c:204: undefined reference to `dtrace_subrstr'
collect2: ld returned 1 exit status
make[2]: *** [../../build-2.6.32-38-generic/dtrace] Error 1
make[1]: *** [do_cmds] Error 2
tools/bug.sh
make: *** [all] Error 1

cannot unload dtracedrv (& hanged processes?)

After doing "make unl" (or manual rmmod), kernel error is fired:
https://gist.github.com/3805133

Also noticeable thing is that some of processes I was trying to examine (via pid$ provider) are hanged and does not response :-(
Is it possible that dtrace is waiting (even if no D script is running at the moment) for any of them and that's the reason why it couldn't unload?

Tom

mkerrtags.sh build error on Ubuntu 10.04.4 system

mkerrtags.sh <dt_errtags.h > dt_errtags.c
/bin/sh: mkerrtags.sh: not found
make[2]: *** [dt_errtags.c] Error 127
rm dt_decl.o dt_dof.o dt_cc.o dt_cg.o dt_consume.o dt_buf.o dt_as.o dt_aggregate.o dt_error.o dt_dis.o
make[1]: *** [do_cmds] Error 2
tools/bug.sh
======================
== Sorry - but dtrace failed to compile on your system.
== Please forward the following file to:
==
== file: /tmp/dtrace-bug.15221
== mail: [email protected]
==
== and the information provided will be used to help
== enhance the tool and fix the underlying issue.
==
== Latest news and blog updates on dtrace available here. Please
== check for latest problem reports.
==
== http://crtags.blogspot.com
== http://www.crisp.demon.co.uk/blog/
==
== Latest downloads available from here:
==
== ftp://crisp.dyndns-server.com/pub/release/website/dtrace
== ======================
(generating a make run - this may take a few moments...)
make: *** [all] Error 1

Build error in driver/mutex.c: invalid storage class for function 'DEFINE_SEMAPHORE'

Executing: /home/marca/src/dtrace4linux/newlinux/tools/make-me
make -C /lib/modules/2.6.32-38-generic/build M=/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver
  CC [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.o
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.c: In function 'dmutex_init':
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.c:48: warning: type defaults to 'int' in declaration of 'DEFINE_SEMAPHORE'
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.c:48: warning: parameter names (without types) in function declaration
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.c:48: error: invalid storage class for function 'DEFINE_SEMAPHORE'
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.c:51: error: 'null_sema' undeclared (first use in this function)
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.c:51: error: (Each undeclared identifier is reported only once
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.c:51: error: for each function it appears in.)
make[3]: *** [/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/mutex.o] Error 1
make[2]: *** [_module_/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver] Error 2
make[1]: *** [kernel] Error 2
tools/bug.sh
make: *** [all] Error 1
marca@ubuntu:~/src/dtrace4linux/newlinux$ uname -a
Linux ubuntu 2.6.32-38-generic #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012 i686 GNU/Linux

marca@ubuntu:~/src/dtrace4linux/newlinux$ dpkg -l | grep 'linux-'
ii  linux-firmware                       1.34.7                                          Firmware for Linux kernel drivers
ii  linux-generic                        2.6.32.38.44                                    Complete Generic Linux kernel
ii  linux-headers-2.6.32-38              2.6.32-38.83                                    Header files related to Linux kernel version 2.6.32
ii  linux-headers-2.6.32-38-generic      2.6.32-38.83                                    Linux kernel headers for version 2.6.32 on x86/x86_64
ii  linux-headers-generic                2.6.32.38.44                                    Generic Linux kernel headers
ii  linux-image-2.6.32-38-generic        2.6.32-38.83                                    Linux kernel image for version 2.6.32 on x86/x86_64
ii  linux-image-generic                  2.6.32.38.44                                    Generic Linux kernel image
ii  linux-libc-dev                       2.6.32-38.83                                    Linux Kernel Headers for development
ii  linux-sound-base                     1.0.22.1+dfsg-0ubuntu3                          base package for ALSA and OSS sound systems
ii  linux-source                         2.6.32.38.44                                    Linux kernel source with Ubuntu patches
ii  linux-source-2.6.32                  2.6.32-38.83                                    Linux kernel source for version 2.6.32 with Ubuntu pa
ii  linux-tools                          2.6.32.38.44                                    Linux kernel versioned Tools
ii  linux-tools-2.6.32-38                2.6.32-38.83                                    Linux kernel tools for version 2.6.32-38
ii  linux-tools-common                   2.6.32-38.83                                    Linux kernel specific tools for version 2.6.32

marca@ubuntu:~/src/dtrace4linux/newlinux$ ack-grep DEFINE_SEMAPHORE /usr/include

marca@ubuntu:~/src/dtrace4linux/newlinux$ grep -r DEFINE_SEMAPHORE *
build/driver/mutex.c:static DEFINE_SEMAPHORE(null_sema);
build-2.6.32-38-generic/driver/mutex.c:static DEFINE_SEMAPHORE(null_sema);
driver/mutex.c:static DEFINE_SEMAPHORE(null_sema);

Failure to link Ruby 2

Trying to compile Ruby 2.0.0-p0 on Ubuntu 12.02.2 LTS results in the following linking error:

...
processing probes in object files
dtrace -G -C -I. -I.ext/include/x86_64-linux -I./include -I. -s ./probes.d -o probes.o array.o eval.o gc.o hash.o load.o object.o parse.o string.o vm.o
<command-line>:0:10: warning: missing whitespace after the macro name [enabled by default]
<command-line>:0:0: warning: "__STDC__" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
Invoking: ld -o probes.o -r probes.tmp.o /usr/lib/dtrace/64/drti.o
linking miniruby
gcc -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -ansi -std=iso9899:199409  -L. -fstack-protector -rdynamic -Wl,-export-dynamic -fstack-protector -pie   main.o dmydln.o dmyencoding.o dmyversion.o miniprelude.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o compile.o debug.o iseq.o vm.o vm_dump.o vm_backtrace.o vm_trace.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o strlcpy.o strlcat.o setproctitle.o addr2line.o  dmyext.o probes.o -lpthread -lrt -ldl -lcrypt -lm   -o miniruby
/usr/bin/ld: probes.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
probes.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [miniruby] Error 1

Donation

Feels dumb to open an issue, but you dont seem to have info on how to donate :p Want to donate £40 to you via Paypal.

Does Dtrace4linux support args?

Dear:

Does Dtrace4linux support args[0], args[1] ...etc.?

This variables is useful for tracing some element in functions.

I got this error message.

dtrace: failed to compile script ./zvolWIO.d: line 32: index 0 is out of range for fbt::zvol_write:entry args[ ]

Just wanna confirm the variables args is supported or not.
(I can not find similar problem by searching so I post this issues.)

Hmm, I found the following dtrace command from Changes in dtrace4linux.

dtrace -n io:::start'{printf("%x %x %x %s %s %p", args[1]->dev_major, args[1]->dev_minor, args[1]->dev_instance, args[2]->fi_pathname, args[1]->dev_pathname, arg2);exit(0);}'

It can work correctly. It seems the args[] can work, but I got some error about out of range.

zvol_write(void *arg)
{
    ......
}

The args[0] should not be out of range.

Does something I wrong?

Thanks!!!

dtrace driver does not appear to be loaded

I am trying to use dtace4linux. I build it on my machine but still it give this error that dtrace driver is not loaded.

I also tried the following : -
[abc@stack linux]$ sudo make test
tools/tests.pl
dtrace driver does not appear to be loaded.
make: *** [test] Error 1

Also there is nothing in dmesg with respect to this error.

I am using CentOS release 6.3 (Final)

I also tried the same on Ubuntu 12.04 but got the same error .

Adopt ZFSOnLinux SPL

Many of the issues porting DTrace and ZFS appear to be the same. Duplication of effort could be avoided if dtrace4linux adopted the ZFSOnLinux SPL.

I am opening this issue as a suggestion and to solicit feedback on the concept. Collaboration between the two projects would probably enable us to tackle openzfs/zfs#645 by creating a ZFS DTrace provider.

make clean probably not cleaning out everything

On Ubuntu 10.04.4:

$ make all

Result: I get the mkerrtags.sh error in issue #2.

$ make clean
$ make all

Result: Now I get linker errors:

cc -g -W -D_ILP32 -D_LONGLONG_TYPE -o ../../build-2.6.32-38-generic/dtrace -L../../build-2.6.32-38-generic ../../build-2.6.32-38-generic/dtrace.o -ldtrace -lctf -lproc -llinux -lz -lrt -lpthread -lelf -ldl
../../build-2.6.32-38-generic/libdtrace.a(dt_cc.o): In function `dt_load_libs_dir':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_cc.c:2228: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_cc.o): In function `dt_load_libs_sort':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_cc.c:2284: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_parser.o): In function `dt_cook_clause':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4082: undefined reference to `dt_errtag'
/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4083: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_parser.o): In function `xyvwarn':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4829: undefined reference to `dt_errtag'
../../build-2.6.32-38-generic/libdtrace.a(dt_parser.o):/home/marca/src/dtrace4linux/linux/libdtrace/dt_parser.c:4863: more undefined references to `dt_errtag' follow
../../build-2.6.32-38-generic/libdtrace.a(dt_dis.o): In function `dt_dis_call':
/home/marca/src/dtrace4linux/linux/libdtrace/dt_dis.c:204: undefined reference to `dtrace_subrstr'
collect2: ld returned 1 exit status
make[2]: *** [../../build-2.6.32-38-generic/dtrace] Error 1
make[1]: *** [do_cmds] Error 2
tools/bug.sh
make: *** [all] Error 1

I suspect that make clean is not removing stuff that should be removed:

marca@ubuntu:~/src/dtrace4linux/linux$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   libdtrace/dt_errtags.c
#   modified:   libdtrace/dt_names.c
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .dtrace.nobug
#   .first-time
#   build
#   build-2.6.32-38-generic/

CPU stuck message in Ubuntu 12.04 (Virtualbox, OSX host)

Hello there. I've been trying to use dtrace4linux in Ubuntu 12.04 server with little success. My latest attempt was within a Virtualbox VM, hosted in OSX (I understand that's mostly how you test the port). From a fresh install, I upgraded all packages, then upgraded the kernel to 3.20-51-generic. Then git cloned dtrac4linux, ran tools/get-deps.pl, make all, make install, make load, make test. I haven't figured out how to cut and past from the VM screen, so here's a screenshot. Any suggestions will be more than welcome. Also, is there any other site where dtrace4linux users gather to support each other, cry on each other's shoulders? Here it is:

traceerror1

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.