components/open-fabrics/qperf/patches/base.patch
branchs11u1-sru
changeset 2761 91830550729b
parent 741 83cb76377624
equal deleted inserted replaced
2755:3f8ffd095fee 2761:91830550729b
   160 +#endif
   160 +#endif
   161 +
   161 +
   162      /* Number of CPUs */
   162      /* Number of CPUs */
   163      if (cpus == 1)
   163      if (cpus == 1)
   164          count[0] = '\0';
   164          count[0] = '\0';
   165 @@ -2615,9 +2661,15 @@
   165 @@ -2615,14 +2661,20 @@
   166  static void
   166  static void
   167  set_affinity(void)
   167  set_affinity(void)
   168  {
   168  {
   169 +#if !(defined(__SVR4) && defined(__sun))
   169 +#if !(defined(__SVR4) && defined(__sun))
   170      cpu_set_t set;
   170      cpu_set_t set;
   171 +#endif
   171 +#endif
   172      int a = Req.affinity;
   172      int a = Req.affinity;
   173  
   173  
   174 +#if defined(__SVR4) && defined(__sun)
       
   175 +    if (processor_bind(P_LWPID, P_MYID, a, NULL) != 0)
       
   176 +        error(SYS, "cannot set processor affinity (cpu %d)", a);
       
   177 +#else
       
   178      if (!a)
   174      if (!a)
   179          return;
   175          return;
       
   176 +#if defined(__SVR4) && defined(__sun)
       
   177 +    if (processor_bind(P_LWPID, P_MYID, a - 1, NULL) != 0)
       
   178 +#else
   180      CPU_ZERO(&set);
   179      CPU_ZERO(&set);
   181 @@ -2624,6 +2676,7 @@
       
   182      CPU_SET(a-1, &set);
   180      CPU_SET(a-1, &set);
   183      if (sched_setaffinity(0, sizeof(set), &set) < 0)
   181      if (sched_setaffinity(0, sizeof(set), &set) < 0)
       
   182 +#endif
   184          error(SYS, "cannot set processor affinity (cpu %d)", a-1);
   183          error(SYS, "cannot set processor affinity (cpu %d)", a-1);
   185 +#endif
   184  }
   186  }
   185  
   187  
   186 @@ -2771,9 +2823,36 @@
   188  
       
   189 @@ -2771,9 +2824,36 @@
       
   190  /*
   187  /*
   191   * Get various temporal parameters.
   188   * Get various temporal parameters.
   192   */
   189   */
   193 +#if (defined(__SVR4) && defined(__sun))
   190 +#if (defined(__SVR4) && defined(__sun))
   194 +
   191 +
   221 +get_times(CLOCK timex[T_N])
   218 +get_times(CLOCK timex[T_N])
   222 +{
   219 +{
   223      int n;
   220      int n;
   224      char *p;
   221      char *p;
   225      char buf[BUFSIZE];
   222      char buf[BUFSIZE];
   226 @@ -2802,6 +2882,7 @@
   223 @@ -2802,6 +2881,7 @@
   227      while (n < T_N)
   224      while (n < T_N)
   228          timex[n++] = 0;
   225          timex[n++] = 0;
   229  }
   226  }
   230 +#endif
   227 +#endif
   231  
   228