summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok/two.stp
blob: 764765c2434956a8973060363e107421fe9b6d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/sh

stap -p4 -g $@ - <<'END'

%{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/version.h>
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
#include <linux/utsrelease.h>
#else
#include <generated/utsrelease.h>
#endif
%}

function get_release () %{
strncpy(THIS->__retvalue, UTS_RELEASE, MAXSTRINGLEN);
%}

probe begin
{
	log("hello from systemtap, kernel version " . get_release())
}

END