Bug 27829 - support for floating point values passed through sdt.h markers
Summary: support for floating point values passed through sdt.h markers
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-07 02:06 UTC by Frank Ch. Eigler
Modified: 2021-10-19 18:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments
partial patch (761 bytes, patch)
2021-05-07 02:06 UTC, Frank Ch. Eigler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2021-05-07 02:06:15 UTC
Created attachment 13422 [details]
partial patch

While stap has recently developed the ability access floating point parameters passed through dwarf-designated locations, we can't do that for sdt.h.  That's for a couple of reasons: 

- tapsets.cxx sdt_uprobe_var_expanding_visitor::build_dwarf_registers does not recognize FP register names
- includes/sys/sdt.h uses an STAP_SDT_ARG_CONSTRAINT that excludes FP registers (so FP values are copied into integer registers anyway)
- includes/sys/sdt.h has no way of marking up floating-point vs integer registers

A partial patch for the first two parts is attached, for x86-64.
The latter requires some coordination with other sdt.h consumers, in order to parse a modification of the operand description syntax.  One possibility:

Instead of:

% readelf -n stap
stapsdt              0x0000003b       NT_STAPSDT (SystemTap probe descriptors)
[...]
    Arguments: 8@%xmm0 4@%xmm1

use:

stapsdt              0x0000003b       NT_STAPSDT (SystemTap probe descriptors)
[...]
    Arguments: 8f@%xmm0 4f@%xmm1

i.e., insert an "f" char between the length and the "@" sign.  We could/should do that even if the floats were copied into an integer register due to operand constraints.
Comment 1 Stan Cox 2021-10-19 18:43:00 UTC
eaa15b047 
 Add 'f' type, x8664 and aarch64 float regs
b6f7ffb69
 Add s390 float regs
6fd6d5e29
 Add dyninst softfloat support