#! /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 () %{
strlcpy(STAP_RETVALUE, UTS_RELEASE, MAXSTRINGLEN);
%}

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

END
