File Revert-lparstat-Show-available-physical-processors-i.patch of Package powerpc-utils.17788
References: bsc#1120474
Upstream: no, SLE compatibility patch
Index: powerpc-utils-1.3.7/man/lparstat.8
===================================================================
--- powerpc-utils-1.3.7.orig/man/lparstat.8
+++ powerpc-utils-1.3.7/man/lparstat.8
@@ -83,9 +83,6 @@ Shows the percentage of the entitled cap
lbusy
Shows the percentage of logical processor(s) utilization that occurred while executing at the user and system level.
.TP
-app
-Shows the available physical processors in the shared pool.
-.TP
phint
Shows the number of phantom (targeted to another shared partition in this pool) interruptions received.
.SH OPTIONS
Index: powerpc-utils-1.3.7/src/lparstat.c
===================================================================
--- powerpc-utils-1.3.7.orig/src/lparstat.c
+++ powerpc-utils-1.3.7/src/lparstat.c
@@ -126,32 +126,6 @@ int get_time_base()
return 0;
}
-void get_sys_uptime(struct sysentry *unused_se, char *uptime)
-{
- FILE *f;
- char buf[80];
-
- f = fopen("/proc/uptime", "r");
- if (!f) {
- fprintf(stderr, "Could not open /proc/uptime\n");
- sprintf(uptime, SE_NOT_VALID);
- return;
- }
-
- if ((fgets(buf, 80, f)) != NULL) {
- char *value;
-
- value = strchr(buf, ' ');
- *value = '\0';
- sprintf(uptime, "%s", buf);
- } else {
- sprintf(uptime, SE_NOT_VALID);
- }
-
- fclose(f);
-}
-
-
void get_cpu_physc(struct sysentry *unused_se, char *buf)
{
struct sysentry *se;
@@ -194,44 +168,6 @@ void get_per_entc(struct sysentry *unuse
sprintf(buf, "%.2f", atof(physc) / atof(entc) * 100.0);
}
-void get_cpu_app(struct sysentry *unused_se, char *buf)
-{
- struct sysentry *se;
- float timebase, app, elapsed_time;
- long long new_app, old_app, newtime, oldtime;
- char *descr, uptime[32];
-
- se = get_sysentry("time");
- if (se->old_value[0] == '\0') {
- /* Single report since boot */
- get_sysdata("uptime", &descr, uptime);
-
- if (!strcmp(uptime, SE_NOT_VALID)) {
- sprintf(buf, "-");
- return;
- }
- elapsed_time = atof(uptime);
- } else {
- newtime = strtoll(se->value, NULL, 0);
- oldtime = strtoll(se->old_value, NULL, 0);
- elapsed_time = (newtime - oldtime) / 1000000.0;
- }
-
- se = get_sysentry("timebase");
- timebase = atof(se->value);
-
- se = get_sysentry("pool_idle_time");
- new_app = strtoll(se->value, NULL, 0);
- if (se->old_value[0] == '\0') {
- old_app = 0;
- } else {
- old_app = strtoll(se->old_value, NULL, 0);
- }
-
- app = (new_app - old_app)/timebase/elapsed_time;
- sprintf(buf, "%.2f", app);
-}
-
int parse_lparcfg()
{
FILE *f;
@@ -615,14 +551,14 @@ int print_iflag_data()
void print_default_output(int interval, int count)
{
- char *fmt = "%5s %5s %5s %8s %8s %5s %5s %5s %5s %5s\n";
+ char *fmt = "%5s %5s %5s %8s %8s %5s %5s %5s %5s\n";
char *descr;
char buf[128];
int offset, smt, active_proc;
char type[32];
char value[32];
char user[32], sys[32], wait[32], idle[32], physc[32], entc[32];
- char lbusy[32], app[32], vcsw[32], phint[32];
+ char lbusy[32], vcsw[32], phint[32];
memset(buf, 0, 128);
get_sysdata("shared_processor_mode", &descr, value);
@@ -657,9 +593,9 @@ void print_default_output(int interval,
fprintf(stdout, "\nSystem Configuration\n%s\n\n", buf);
fprintf(stdout, fmt, "\%user", "\%sys", "\%wait", "\%idle", "physc",
- "\%entc", "lbusy", "app", "vcsw", "phint");
+ "\%entc", "lbusy", "vcsw", "phint");
fprintf(stdout, fmt, "-----", "-----", "-----", "-----", "-----",
- "-----", "-----", "-----", "-----", "-----");
+ "-----", "-----", "-----", "-----");
do {
if (interval) {
@@ -676,10 +612,9 @@ void print_default_output(int interval,
get_sysdata("physc", &descr, physc);
get_sysdata("per_entc", &descr, entc);
get_sysdata("phint", &descr, phint);
- get_sysdata("app", &descr, app);
fprintf(stdout, fmt, user, sys, wait, idle, physc, entc,
- lbusy, app, vcsw, phint);
+ lbusy, vcsw, phint);
fflush(stdout);
} while (--count > 0);
}
Index: powerpc-utils-1.3.7/src/lparstat.h
===================================================================
--- powerpc-utils-1.3.7.orig/src/lparstat.h
+++ powerpc-utils-1.3.7/src/lparstat.h
@@ -46,8 +46,6 @@ extern void get_smt_mode(struct sysentry
extern void get_cpu_stat(struct sysentry *, char *);
extern void get_cpu_physc(struct sysentry *, char *);
extern void get_per_entc(struct sysentry *, char *);
-extern void get_cpu_app(struct sysentry *, char *);
-extern void get_sys_uptime(struct sysentry *, char *);
struct sysentry system_data[] = {
/* System Names */
@@ -227,9 +225,6 @@ struct sysentry system_data[] = {
{.name = "per_entc",
.descr = "Entitled CPU Consumed",
.get = &get_per_entc},
- {.name = "app",
- .descr = "Available physical CPUs in pool",
- .get = &get_cpu_app},
/* Time */
{.name = "time",
@@ -243,11 +238,6 @@ struct sysentry system_data[] = {
{.name = "phint",
.descr = "Phantom Interrupts"},
- /* /proc/uptime */
- {.name = "uptime",
- .descr = "System Uptime",
- .get = &get_sys_uptime},
-
{.name[0] = '\0'},
};