This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/13283] script -> C translator incorrect comparison (using ==) of kernel_string() operands
- From: "david.pat.skindell at hp dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Wed, 12 Oct 2011 17:33:06 +0000
- Subject: [Bug translator/13283] script -> C translator incorrect comparison (using ==) of kernel_string() operands
- Auto-submitted: auto-generated
- References: <bug-13283-6586@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13283
--- Comment #3 from David Skindell <david.pat.skindell at hp dot com> 2011-10-12 17:33:06 UTC ---
That would seem to be the problem. I do change the variables in a
separate call probe.
I didn't come across the '@entry' when reading the language reference
but I'll try it out.
However, I still find it odd that doing
*/kernel_string(str_ptr1) == kernel_string(str_ptr2)/*
doesn't yield the same as
*/str1 = kernel_string(str_ptr1);
str2 = kernel_string(str_ptr2)/
/str1 == str2/*
Does doing the variable assignment force-ably get the "current" value
storage at some address?
Why does the *first* get the entry-time values while the *second* does not?
On 10/12/2011 11:31 AM, fche at redhat dot com wrote:
> http://sourceware.org/bugzilla/show_bug.cgi?id=13283
>
> Frank Ch. Eigler<fche at redhat dot com> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Status|NEW |WAITING
> CC| |fche at redhat dot com
>
> --- Comment #1 from Frank Ch. Eigler<fche at redhat dot com> 2011-10-12 16:31:29 UTC ---
> Could you attach the actual stap script too?
> Please be aware that in a .return probe, $variables refer to entry-time
> snapshots of the expression, so if those values were changed during
> the function's execution, you may get misleading results.
>
> printf("Equal? %X\n",
> kernel_char($dev1->scsi3addr) ==
> kernel_char($dev2->scsi3addr));
>
> You may have intended something like
>
> kernel_char(@entry($dev1)->scsi3addr) ==
> kernel_char(@entry($dev2)->scsi3addr)
>
> where the scsi3addr dereferencing is explicitly done at return time.
>
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.