Closed Bug 1355136 Opened 7 years ago Closed 7 years ago

LUL on i686/x86_64-linux: allow CFAs to be arbitrary prefix expressions

Categories

(Core :: Gecko Profiler, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jseward, Assigned: jseward)

Details

Attachments

(1 file)

For reasons which are unclear, but possibly due to lack of any known use cases
when the code was written, LUL on i686/x86_64-linux only accepts CFA (canonical
frame address) expressions of the form SP+offset or FP+offset.  However, on
Fedora 25 x86_64 and Ubuntu 16.10 x86_64, at least one address range per object
uses a Dwarf expression for the CFA, for example:

00000018 0000000000000024 0000001c FDE cie=00000000 pc=00000000000031e0..00000000000031f0
  DW_CFA_def_cfa_offset: 16
  DW_CFA_advance_loc: 6 to 00000000000031e6
  DW_CFA_def_cfa_offset: 24
  DW_CFA_advance_loc: 10 to 00000000000031f0
  DW_CFA_def_cfa_expression (DW_OP_breg7 (rsp): 8; DW_OP_breg16 (rip): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit11; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus)
  DW_CFA_nop
  DW_CFA_nop
  DW_CFA_nop
  DW_CFA_nop

producing the following complaint from LUL:

[Main Thread]: V/prof [32573] LUL  can't summarise: SVMA=0x31f0: rule for DW_REG_CFA: invalid |how|, expr=LExpr(PFXEXPR,0,0)

Given that LUL is perfectly capable of handling such a CFA expression, it seems
artificial to stop it doing so.
For reasons which are unclear, but possibly due to lack of any known use cases
when the code was written, LUL on i686/x86_64-linux only accepts CFA (canonical
frame address) expressions of the form SP+offset or FP+offset.  However, on
Fedora 25 x86_64 and Ubuntu 16.10 x86_64, at least one address range per object
uses a Dwarf expression for the CFA, for example:

00000018 000000000024 0000001c FDE cie=00000000 pc=0000000031e0..0000000031f0
  DW_CFA_def_cfa_offset: 16
  DW_CFA_advance_loc: 6 to 00000000000031e6
  DW_CFA_def_cfa_offset: 24
  DW_CFA_advance_loc: 10 to 00000000000031f0
  DW_CFA_def_cfa_expression(
          DW_OP_breg7 (rsp): 8; DW_OP_breg16 (rip): 0; DW_OP_lit15; DW_OP_and;
          DW_OP_lit11; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus)

producing the following complaint from LUL:

  can't summarise: SVMA=0x31f0: rule for DW_REG_CFA: invalid |how|, expr=LExpr(PFXEXPR,0,0)

Given that LUL is capable of handling such a CFA expression, it seems artificial
to stop it doing so.  This patch changes Summariser::Rule() so as to allow such
expressions.
Attachment #8857346 - Flags: review?(nfroyd)
Assignee: nobody → jseward
Status: NEW → ASSIGNED
Comment on attachment 8857346 [details] [diff] [review]
LUL on i686/x86_64-linux: allow CFAs to be arbitrary prefix expressions

Review of attachment 8857346 [details] [diff] [review]:
-----------------------------------------------------------------

You know, I was just wondering yesterday how they expressed dynamic stack alignment in the dwarf unwind rules, and there you go.
Attachment #8857346 - Flags: review?(nfroyd) → review+
Pushed by jseward@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/93166de3c8f8
LUL on i686/x86_64-linux: allow CFAs to be arbitrary prefix expressions.  r=froydnj.
https://hg.mozilla.org/mozilla-central/rev/93166de3c8f8
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: