summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-03-30 17:23:42 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-03-30 17:23:42 -0400
commit5cad2d3b056059758d44b4dd56abe37ca9c841a6 (patch)
treebb693b3d59ca7e3fd33a3c0155dea15542286142
parentbcc2b3536d6efb5857c16704f99b772655981cdd (diff)
downloadsystemtap-steved-5cad2d3b056059758d44b4dd56abe37ca9c841a6.tar.gz
systemtap-steved-5cad2d3b056059758d44b4dd56abe37ca9c841a6.tar.xz
systemtap-steved-5cad2d3b056059758d44b4dd56abe37ca9c841a6.zip
PR9998: adapt tapset/i686/registers.stp to latest kernel
* buildrun.cxx (compile_pass): Add autoconf-x86-gs.c. * tapset/i686/registers.stp (_stp_register_regs): Update offsets. (test_x86_gs): Auxiliary function. * runtime/autoconf-x86-gs.c : New file. * testsuite/systemtap.base/x86_gs.exp : New test case. * testsuite/systemtap.base/x86_gs.stp : Ditto.
-rw-r--r--buildrun.cxx1
-rw-r--r--tapset/i686/registers.stp50
2 files changed, 33 insertions, 18 deletions
diff --git a/buildrun.cxx b/buildrun.cxx
index e19043cf..97357692 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -149,6 +149,7 @@ compile_pass (systemtap_session& s)
output_autoconf(s, o, "autoconf-procfs-owner.c", "STAPCONF_PROCFS_OWNER", NULL);
output_autoconf(s, o, "autoconf-alloc-percpu-align.c", "STAPCONF_ALLOC_PERCPU_ALIGN", NULL);
output_autoconf(s, o, "autoconf-find-task-pid.c", "STAPCONF_FIND_TASK_PID", NULL);
+ output_autoconf(s, o, "autoconf-x86-gs.c", "STAPCONF_X86_GS", NULL);
#if 0
/* NB: For now, the performance hit of probe_kernel_read/write (vs. our
diff --git a/tapset/i686/registers.stp b/tapset/i686/registers.stp
index a6e5694e..997376dc 100644
--- a/tapset/i686/registers.stp
+++ b/tapset/i686/registers.stp
@@ -1,25 +1,39 @@
global _reg_offsets, _stp_regs_registered, _sp_offset, _ss_offset
+function test_x86_gs:long() %{ /* pure */
+#ifdef STAPCONF_X86_GS
+ THIS->__retvalue = 1;
+#else
+ THIS->__retvalue = 0;
+#endif
+%}
+
function _stp_register_regs() {
+
/* Same order as pt_regs */
- _reg_offsets["ebx"] = 0 _reg_offsets["bx"] = 0
- _reg_offsets["ecx"] = 4 _reg_offsets["cx"] = 4
- _reg_offsets["edx"] = 8 _reg_offsets["dx"] = 8
- _reg_offsets["esi"] = 12 _reg_offsets["si"] = 12
- _reg_offsets["edi"] = 16 _reg_offsets["di"] = 16
- _reg_offsets["ebp"] = 20 _reg_offsets["bp"] = 20
- _reg_offsets["eax"] = 24 _reg_offsets["ax"] = 24
- _reg_offsets["xds"] = 28 _reg_offsets["ds"] = 28
- _reg_offsets["xes"] = 32 _reg_offsets["es"] = 32
- _reg_offsets["xfs"] = 36 _reg_offsets["fs"] = 36
- _reg_offsets["orig_eax"] = 40 _reg_offsets["orig_ax"] = 40
- _reg_offsets["eip"] = 44 _reg_offsets["ip"] = 44
- _reg_offsets["xcs"] = 48 _reg_offsets["cs"] = 48
- _reg_offsets["eflags"] = 52 _reg_offsets["flags"] = 52
- _reg_offsets["esp"] = 56 _reg_offsets["sp"] = 56
- _reg_offsets["xss"] = 60 _reg_offsets["ss"] = 60
- _sp_offset = 56
- _ss_offset = 60
+ _reg_offsets["ebx"] = 0 _reg_offsets["bx"] = 0
+ _reg_offsets["ecx"] = 4 _reg_offsets["cx"] = 4
+ _reg_offsets["edx"] = 8 _reg_offsets["dx"] = 8
+ _reg_offsets["esi"] = 12 _reg_offsets["si"] = 12
+ _reg_offsets["edi"] = 16 _reg_offsets["di"] = 16
+ _reg_offsets["ebp"] = 20 _reg_offsets["bp"] = 20
+ _reg_offsets["eax"] = 24 _reg_offsets["ax"] = 24
+ _reg_offsets["xds"] = 28 _reg_offsets["ds"] = 28
+ _reg_offsets["xes"] = 32 _reg_offsets["es"] = 32
+ _reg_offsets["xfs"] = 36 _reg_offsets["fs"] = 36
+ gs_incr = 0
+if (test_x86_gs()) {
+ gs_incr = 4
+ _reg_offsets["xgs"] = 40 _reg_offsets["gs"] = 40
+}
+ _reg_offsets["orig_eax"] = 40 + gs_incr _reg_offsets["orig_ax"] = 40 + gs_incr
+ _reg_offsets["eip"] = 44 + gs_incr _reg_offsets["ip"] = 44 + gs_incr
+ _reg_offsets["xcs"] = 48 + gs_incr _reg_offsets["cs"] = 48 + gs_incr
+ _reg_offsets["eflags"] = 52 + gs_incr _reg_offsets["flags"] = 52 + gs_incr
+ _reg_offsets["esp"] = 56 + gs_incr _reg_offsets["sp"] = 56 + gs_incr
+ _reg_offsets["xss"] = 60 + gs_incr _reg_offsets["ss"] = 60 + gs_incr
+ _sp_offset = 56 + gs_incr
+ _ss_offset = 60 + gs_incr
_stp_regs_registered = 1
}