<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: porting Solaris app to HPUX in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802086#M99906</link>
    <description>pstat has some CPU info. But the difficult part is in question 1. I could not get related info from google.</description>
    <pubDate>Thu, 08 Jun 2006 01:12:22 GMT</pubDate>
    <dc:creator>yingbin</dc:creator>
    <dc:date>2006-06-08T01:12:22Z</dc:date>
    <item>
      <title>porting Solaris app to HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802084#M99904</link>
      <description>Hi&lt;BR /&gt;Can anybody help for my porting issue?  I am working on porting our application to HPUX 11i environment.&lt;BR /&gt;But I could not find correspondent syscall for Solaris kstat structure.&lt;BR /&gt;Here are some scenarios:&lt;BR /&gt;1. Network:&lt;BR /&gt;get network input trafifc:&lt;BR /&gt;   ksname = (kstat_named_t *) kstat_data_lookup(ksp, "rbytes");&lt;BR /&gt;get network output traffic:&lt;BR /&gt;   ksname = (kstat_named_t *) kstat_data_lookup(ksp, "obytes");&lt;BR /&gt;snap time:&lt;BR /&gt;    newhrtime = ksp-&amp;gt;ks_snaptime;&lt;BR /&gt;&lt;BR /&gt;2. CPU:&lt;BR /&gt;collect  CPU usages:&lt;BR /&gt;....//ksp come from kstat structure in Solaris&lt;BR /&gt;    for ( ksp = kstatControlPtr-&amp;gt;kc_chain; ksp; ksp = ksp-&amp;gt;ks_next )&lt;BR /&gt;   {&lt;BR /&gt;       if ( strncmp(ksp-&amp;gt;ks_name, "cpu_stat", 8 ) == 0 ) {&lt;BR /&gt;           if ( kstat_read(kstatControlPtr, ksp, NULL) == -1 )&lt;BR /&gt;           {&lt;BR /&gt;               // Error....&lt;BR /&gt;           }&lt;BR /&gt;           memcpy(&amp;amp;cpu_stats[j], ksp-&amp;gt;ks_data, sizeof(cpu_stats[j]));&lt;BR /&gt;           j++;&lt;BR /&gt;       }&lt;BR /&gt;....//we got cpu_stats array.&lt;BR /&gt;   }&lt;BR /&gt;.....&lt;BR /&gt;   /* Calculate CPU load distribution in idle, user and system states */&lt;BR /&gt;   for ( int i = 0; i &amp;lt; ncpus &amp;amp;&amp;amp; i &amp;lt; noofCpus; i++ )&lt;BR /&gt;   {&lt;BR /&gt;&lt;BR /&gt;       newCpuIdleTimeCounter[i] = cpu_stats[i].cpu_sysinfo.cpu[CPU_IDLE];&lt;BR /&gt;       newCpuUserTimeCounter[i] = cpu_stats[i].cpu_sysinfo.cpu[CPU_USER];&lt;BR /&gt;       newCpuKernelTimeCounter[i] = cpu_stats[i].cpu_sysinfo.cpu[CPU_KERNEL];&lt;BR /&gt;       newCpuWaitTimeCounter[i] = cpu_stats[i].cpu_sysinfo.cpu[CPU_WAIT];&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;How do I use HPUX call to achieve same functionality?</description>
      <pubDate>Wed, 07 Jun 2006 20:42:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802084#M99904</guid>
      <dc:creator>yingbin</dc:creator>
      <dc:date>2006-06-07T20:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: porting Solaris app to HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802085#M99905</link>
      <description>You will have to look at all of the pstat(2) variants.  Most likely pstat_getprocessor() for your CPU stats?</description>
      <pubDate>Wed, 07 Jun 2006 21:16:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802085#M99905</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-06-07T21:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: porting Solaris app to HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802086#M99906</link>
      <description>pstat has some CPU info. But the difficult part is in question 1. I could not get related info from google.</description>
      <pubDate>Thu, 08 Jun 2006 01:12:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802086#M99906</guid>
      <dc:creator>yingbin</dc:creator>
      <dc:date>2006-06-08T01:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: porting Solaris app to HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802087#M99907</link>
      <description>Hi,&lt;BR /&gt;this will not help very much, but from another thread:&lt;BR /&gt;"Sadly HP-UX hides this data and requires you to buy e.g. Glance to access the data.&lt;BR /&gt;Nevertheless you can use plug-ins based on common user space Unix commands such as&lt;BR /&gt;uptime, ps, vmstat, iostat, sar, nfsstat etc."</description>
      <pubDate>Thu, 08 Jun 2006 03:19:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802087#M99907</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-06-08T03:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: porting Solaris app to HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802088#M99908</link>
      <description>If you are running SNMP on the system you could issue MIB queries.&lt;BR /&gt;&lt;BR /&gt;Take a look at the manual in docs.hp.com for DLPI - IIRC there is a stats message one could send to each driver to get their (link-level) stats which I suspect would match those from the lanadmin -g mibstats &lt;PPA&gt; command.&lt;BR /&gt;&lt;BR /&gt;You might also go poking about in /usr/include, but keep in mind that not everything one finds there is documented and so you may be on your own.&lt;BR /&gt;&lt;BR /&gt;The DSPP - &lt;A href="http://devresource.hp.com/" target="_blank"&gt;http://devresource.hp.com/&lt;/A&gt; might be a good place to look.&lt;BR /&gt;&lt;BR /&gt;BTW, wrt the CPU stats you get from kstat on solaris - they do _not_ include time spent processing interrupts.  I found this the hard way porting netperf.  Time spent processing interrupts is tracked independent of user/sys/idle.  In &lt;A href="http://www.netperf.org/svn/neperf2/src/netcpu_kstat10.c" target="_blank"&gt;http://www.netperf.org/svn/neperf2/src/netcpu_kstat10.c&lt;/A&gt; (IIRC that is the file) you can see the handwaving I had to do for that.&lt;BR /&gt;&lt;BR /&gt;To see what I mean, run something interrupt intensive like netperf and bind the netperf or the netserver (depending on which way you are testing) to a CPU other than the one taking interrupts from the NIC.  Run mpstat while netperf is running.  Many's the time you will see (generally when the system is otherwise idle) the CPU taking interrups having its interrupt count quite large but still reporting 100% idle CPU.&lt;BR /&gt;&lt;BR /&gt;Feel free to peruse the other netcpu files there for ideas for say HP-UX 11.23.  Netperf though, strange as it may seem, does not try to extract networking stats from the system :)&lt;BR /&gt;&lt;/PPA&gt;</description>
      <pubDate>Thu, 08 Jun 2006 19:28:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/porting-solaris-app-to-hpux/m-p/3802088#M99908</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2006-06-08T19:28:28Z</dc:date>
    </item>
  </channel>
</rss>

