Unix Linux

Using kstat From Within a Program in the Solaris OS

_침묵_ 2007. 3. 27. 05:55

출처 :http://developers.sun.com/solaris/articles/kstat_api.html?feed=DSC

 

Introduction

Working in Sun's Adoption Systems Practice for the Solaris 10 OS, I do performance analysis and support software development in the U.S. Frequently, during the course of my work, I run across situations in which customers are usingsystem()to execute a script that usesawk,perf,grep,cut, and so on to extract various operating system metrics of interest. The numerous forks and execs are expensive and harm performance. I usually suggest using thelibkstatAPIs to determine the desired metrics from within the program code. I am often asked to provide examples on how to use thekstatAPIs.

 

This article provides examples on how to use thekstatandlibkstatAPIs to extract metrics from the Solaris OS. The examples include "Walking Through All thekstat" and "Getting NICkstatOutput Using the Java Platform."

 

Download the document asPDF.