This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Why can't I call a (Embedded C) function from another (Embedded C) function?
- From: Om Narasimhan <om dot turyx at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Sat, 06 Sep 2008 17:46:37 -0700
- Subject: Re: Why can't I call a (Embedded C) function from another (Embedded C) function?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Z+N+H+RthXtXJaeUNtg44J4dTGbNRYN9fwTR+uN5lZI=; b=hvl2hcvDXVDZkzcb3MrizFmMbjI3bsNLIC1+wNvx19Qc57+DlZEleSeYeTvxew6RhN 3sLBVJVeXZhbSvGPS/2ZOFHxVT5gJnM3hMqgi3OEVV+UhqwPB7J6XtHcL+u9w26FcOaR Ys859N/ubmnStvJSUll4D/PfuXU9wPQBeVJc8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=ad4AjoMl39qr5SSZ3JjR86FglPzIrG/iUzyo/Vzylq5QQ2xRmpaW+cvWRu+yGHm737 3qutZeuyOVdOtq+vF22L2Z9kiNxiN1zSnwrd+BQsMRqxi/Ey/IxM4p3dbuKWKAhb9LA9 8Ah0ooLKN2QWiFXs+mKXvSiJJTY8/Qc6afT8Y=
- References: <48C31A7D.4060309@gmail.com>
I figured it out.
Om Narasimhan wrote:
I have this script.
$cat test.stp
function traverse_pid_chain : long(pidnr:long)
%{ /*PURE*/
long pid = (long)THIS->pidnr;
printk("param = %06ld\n", pid);
THIS->__retvalue = 0;
%}
function task_analysis : long()
%{
long traverse_pid_chain(long); /* If I take this out, stap
complains "implicit function declaration" */
traverse_pid_chain(0);
printk("done\n");
THIS->__retvalue = 0;
%}
probe syscall.kill
{
task_analysis()
printf("Called...\n")
}
Errors I get are,
I modified the script to
%{/*PURE*/
long traverse_pid_chain (long pidnr)
{
printk("param = %06ld\n", pidnr);
return 0;
}
%}
function task_analysis : long()
%{/*PURE*/
long traverse_pid_chain(long);
traverse_pid_chain(0);
printk("done\n");
THIS->__retvalue = 0;
%}
probe syscall.kill
{
task_analysis()
printf("Called...\n")
}
And it started working.
Is it a hack or the right way to get such calls working?
Thanks,
Om.