]> sourceware.org Git - systemtap.git/commitdiff
Fix compile-time issues for a few _struct_compat_*_u() functions.
authorMartin Cermak <mcermak@redhat.com>
Mon, 5 Oct 2015 13:58:36 +0000 (15:58 +0200)
committerMartin Cermak <mcermak@redhat.com>
Mon, 5 Oct 2015 13:58:36 +0000 (15:58 +0200)
* tapset/linux/aux_syscalls.stp: Fix _struct_compat_itimerspec_u(),
  and _struct_itimerval_u() so that they compile on non CONFIG_COMPAT
  systems. Fix _struct_sched_attr_u() so that it compiles on kernels
  not having struct sched_attr, i.e. when kernel_v < "3.14".
* testsuite/buildok/aux_syscalls-embedded.stp: Remove unneeded
  constraint for _struct_sched_attr_u() testing.

tapset/linux/aux_syscalls.stp
testsuite/buildok/aux_syscalls-embedded.stp

index 14505d905d7839fa74b58ee538ca3eb428cce980..53050d3a77238997893455806cb92f3c0d798118 100644 (file)
@@ -418,6 +418,7 @@ function _struct_itimerspec_u:string(uaddr:long)
 
 function _struct_compat_itimerspec_u:string(uaddr:long)
 %{ /* pure */
+#ifdef CONFIG_COMPAT
        struct compat_itimerspec its;
        char *ptr = (char *)(unsigned long)STAP_ARG_uaddr;
        
@@ -434,7 +435,8 @@ function _struct_compat_itimerspec_u:string(uaddr:long)
                                 (int)its.it_interval.tv_nsec,
                                 (int)its.it_value.tv_sec,
                                 (int)its.it_value.tv_nsec);
-       }       
+       }
+#endif
 %}
 
 function _struct_itimerval_u:string(uaddr:long)
@@ -5086,6 +5088,7 @@ function _struct_timex_u:string(uaddr:long)
 
 function _struct_compat_timex_u:string(uaddr:long)
 %{
+#ifdef CONFIG_COMPAT
        struct compat_timex ts;
        char *ptr = (char *)(unsigned long)STAP_ARG_uaddr;
        int len;
@@ -5113,6 +5116,7 @@ function _struct_compat_timex_u:string(uaddr:long)
                                 (unsigned long)ptr);
                }
        }
+#endif
 %}
 
 %{
@@ -5888,6 +5892,8 @@ function _kcmp_type_str:string(type:long)
 
 function _struct_sched_attr_u:string(uaddr:long)
 %{ /* pure */
+/* struct sched_attr introduced in kernel commit d50dde5a10 along with SCHED_ATTR_SIZE_VER0 */
+#ifdef SCHED_ATTR_SIZE_VER0
        struct sched_attr sa;
        char *ptr = (char *)(unsigned long)STAP_ARG_uaddr;
        if (ptr == NULL)
@@ -5911,6 +5917,7 @@ function _struct_sched_attr_u:string(uaddr:long)
                                 (unsigned long)ptr);
                }
        }
+#endif
 %}
 
 %{
index da3b2eb091c8cd9860fbdc48a78a27db52c63a38..0d645a76c0081bcec3f00d632a18a4c1f5110785 100755 (executable)
@@ -210,7 +210,7 @@ probe begin {
        print (_fanotify_mark_mask_str(0))
        print (_perf_event_open_flags_str(0))
        print (_kcmp_type_str(0))
-%( kernel_v >= "3.14" %?
        print (_struct_sched_attr_u(0))
-%)
+        print (_struct_compat_itimerspec_u(0))
+        print (_struct_compat_timex_u(0))
 }
This page took 0.035856 seconds and 5 git commands to generate.