2008-03-12 17:32:50

by Martin Schwidefsky

[permalink] [raw]
Subject: [patch 01/10] Add new fields for System z10 to /proc/sysinfo

From: Martin Schwidefsky <[email protected]>

Add permanent and temporary model capacity and the corresponding
capacity value fields for the three capacity identifiers to the
output of /proc/sysinfo.

Signed-off-by: Martin Schwidefsky <[email protected]>
---

drivers/s390/sysinfo.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)

Index: quilt-2.6/drivers/s390/sysinfo.c
===================================================================
--- quilt-2.6.orig/drivers/s390/sysinfo.c
+++ quilt-2.6/drivers/s390/sysinfo.c
@@ -26,6 +26,11 @@ struct sysinfo_1_1_1 {
char sequence[16];
char plant[4];
char model[16];
+ char model_perm_cap[16];
+ char model_temp_cap[16];
+ char model_cap_rating[4];
+ char model_perm_cap_rating[4];
+ char model_temp_cap_rating[4];
};

struct sysinfo_1_2_1 {
@@ -133,6 +138,8 @@ static int stsi_1_1_1(struct sysinfo_1_1
EBCASC(info->sequence, sizeof(info->sequence));
EBCASC(info->plant, sizeof(info->plant));
EBCASC(info->model_capacity, sizeof(info->model_capacity));
+ EBCASC(info->model_perm_cap, sizeof(info->model_perm_cap));
+ EBCASC(info->model_temp_cap, sizeof(info->model_temp_cap));
len += sprintf(page + len, "Manufacturer: %-16.16s\n",
info->manufacturer);
len += sprintf(page + len, "Type: %-4.4s\n",
@@ -155,8 +162,18 @@ static int stsi_1_1_1(struct sysinfo_1_1
info->sequence);
len += sprintf(page + len, "Plant: %-4.4s\n",
info->plant);
- len += sprintf(page + len, "Model Capacity: %-16.16s\n",
- info->model_capacity);
+ len += sprintf(page + len, "Model Capacity: %-16.16s %08u\n",
+ info->model_capacity, *(u32 *) info->model_cap_rating);
+ if (info->model_perm_cap[0] != '\0')
+ len += sprintf(page + len,
+ "Model Perm. Capacity: %-16.16s %08u\n",
+ info->model_perm_cap,
+ *(u32 *) info->model_perm_cap_rating);
+ if (info->model_temp_cap[0] != '\0')
+ len += sprintf(page + len,
+ "Model Temp. Capacity: %-16.16s %08u\n",
+ info->model_temp_cap,
+ *(u32 *) info->model_temp_cap_rating);
return len;
}


--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.


2008-03-12 17:58:19

by Josef 'Jeff' Sipek

[permalink] [raw]
Subject: Re: [patch 01/10] Add new fields for System z10 to /proc/sysinfo

On Wed, Mar 12, 2008 at 06:31:56PM +0100, Martin Schwidefsky wrote:
> From: Martin Schwidefsky <[email protected]>
>
> Add permanent and temporary model capacity and the corresponding
> capacity value fields for the three capacity identifiers to the
> output of /proc/sysinfo.
>
> Signed-off-by: Martin Schwidefsky <[email protected]>
> ---
>
> drivers/s390/sysinfo.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> Index: quilt-2.6/drivers/s390/sysinfo.c
> ===================================================================
> --- quilt-2.6.orig/drivers/s390/sysinfo.c
> +++ quilt-2.6/drivers/s390/sysinfo.c
> @@ -26,6 +26,11 @@ struct sysinfo_1_1_1 {
> char sequence[16];
> char plant[4];
> char model[16];
> + char model_perm_cap[16];
> + char model_temp_cap[16];
> + char model_cap_rating[4];
> + char model_perm_cap_rating[4];
> + char model_temp_cap_rating[4];
> };

I'd try to be safer, and make the struct __attribute__((packed))...

Josef 'Jeff' Sipek.

--
I'm somewhere between geek and normal.
- Linus Torvalds

2008-03-13 10:03:18

by Martin Schwidefsky

[permalink] [raw]
Subject: Re: [patch 01/10] Add new fields for System z10 to /proc/sysinfo

On Wed, 2008-03-12 at 13:57 -0400, Josef 'Jeff' Sipek wrote:
> > Index: quilt-2.6/drivers/s390/sysinfo.c
> > ===================================================================
> > --- quilt-2.6.orig/drivers/s390/sysinfo.c
> > +++ quilt-2.6/drivers/s390/sysinfo.c
> > @@ -26,6 +26,11 @@ struct sysinfo_1_1_1 {
> > char sequence[16];
> > char plant[4];
> > char model[16];
> > + char model_perm_cap[16];
> > + char model_temp_cap[16];
> > + char model_cap_rating[4];
> > + char model_perm_cap_rating[4];
> > + char model_temp_cap_rating[4];
> > };
>
> I'd try to be safer, and make the struct __attribute__((packed))...

Hmm, that would be true for all sysinfo typedefs. The automatic
alignment does the right thing though. Don't know if its worth the
effort - at least until you get bitten for the first time ;-)

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.