- if (time_old != 0)
- {
- counter_t time_diff;
- counter_t entitled_ticks;
- counter_t consumed_ticks;
- counter_t user_diff;
- counter_t syst_diff;
- counter_t wait_diff;
- counter_t idle_diff;
- counter_t unav_diff;
-
- double entitled_pool_capacity;
-
- /* Number of ticks since we last run. */
- time_diff = ((counter_t) data->timebase_last) - time_old;
-
- /* entitled_pool_capacity is in 1/100th of a CPU */
- entitled_pool_capacity = 0.01 * ((double) data->entitled_pool_capacity);
-
- /* The number of ticks this partition would have been entitled to. */
- entitled_ticks = (counter_t) ((entitled_pool_capacity * ((double) time_diff)) + .5);
-
- /* The number of ticks actually spent in the various states */
- user_diff = user - user_old;
- syst_diff = syst - syst_old;
- wait_diff = wait - wait_old;
- idle_diff = idle - idle_old;
- consumed_ticks = user_diff + syst_diff + wait_diff + idle_diff;
-
- if (entitled_ticks >= consumed_ticks)
- unav_diff = entitled_ticks - consumed_ticks;
- else
- unav_diff = 0;
- unav = unav_old + unav_diff;
-
- lpar_submit ("user", user);
- lpar_submit ("system", syst);
- lpar_submit ("wait", wait);
- lpar_submit ("idle", idle);
- lpar_submit ("unavailable", unav);
- }
-
- time_old = (counter_t) data->timebase_last;
- user_old = user;
- syst_old = syst;
- wait_old = wait;
- idle_old = idle;
- unav_old = unav;
-
- return (0);
-} /* int lpar_read_shared_partition */
-
-static int lpar_read_dedicated_partition (const perfstat_partition_total_t *data)
-{
- lpar_submit ("user", (counter_t) data->puser);
- lpar_submit ("system", (counter_t) data->psys);
- lpar_submit ("wait", (counter_t) data->pwait);
- lpar_submit ("idle", (counter_t) data->pidle);