You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(8) |
Sep
(14) |
Oct
(7) |
Nov
(9) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(11) |
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(7) |
Jun
(12) |
Jul
(4) |
Aug
(6) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2011 |
Jan
(2) |
Feb
(3) |
Mar
(10) |
Apr
(7) |
May
(5) |
Jun
(3) |
Jul
(7) |
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(4) |
Dec
(6) |
2012 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(2) |
May
(21) |
Jun
(6) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2013 |
Jan
(10) |
Feb
(8) |
Mar
|
Apr
(9) |
May
(33) |
Jun
(11) |
Jul
(16) |
Aug
(3) |
Sep
(8) |
Oct
(1) |
Nov
(16) |
Dec
(7) |
2014 |
Jan
(19) |
Feb
(71) |
Mar
(46) |
Apr
(16) |
May
(1) |
Jun
(18) |
Jul
(6) |
Aug
(12) |
Sep
(7) |
Oct
(4) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(15) |
Feb
(6) |
Mar
(10) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Kamalesh B. <kam...@li...> - 2015-05-14 08:17:40
|
Teach snap to ignore deprecated sysctl network files, while gathering information from /proc. Reading deprecated file, throws warnings in /var/log/message like: kernel: process `snap' is using deprecated sysctl (syscall) net.ipv6.neigh.default.retrans_time; Use net.ipv6.neigh.default.retrans_time_ms instead.` Signed-off-by: Kamalesh Babulal <kam...@li...> Cc: Vasant Hegde <heg...@li...> Cc: Nathan Fontenot <nf...@li...> --- scripts/snap | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/snap b/scripts/snap index dc8abe1..74d2bfb 100755 --- a/scripts/snap +++ b/scripts/snap @@ -142,6 +142,12 @@ my @snap_command_rsxx = ( "rs_cardreport -d 'all'", ); +# Files, which are to be ignored as they are deprecated +my @snap_deprecated_files = ( + "retrans_time", + "base_reachable_time", +); + sub recurse_dir($); # function prototype sub error { @@ -258,6 +264,7 @@ sub recurse_dir ($) { recurse_dir "$dir/$file"; } else { + next if (grep { /$file/ } @snap_deprecated_files); copy "$dir/$file", $outdir."$dir/$file"; } } -- 2.1.2 |
From: Bharata B R. <bha...@gm...> - 2015-04-16 09:09:23
|
From: Bharata B Rao <bh...@li...> If drc_index is used with -s option and the drc_index specified doesn't correspond to the first available unused LMB, get_available_lmb() ends up returning first available LMB that doesn't match the requested drc_index. Fix this by explicitly checking for drc_index when drc_index is specified with -s option. Signed-off-by: Bharata B Rao <bh...@li...> --- src/drmgr/drslot_chrp_mem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c index c12e363..02ca978 100644 --- a/src/drmgr/drslot_chrp_mem.c +++ b/src/drmgr/drslot_chrp_mem.c @@ -502,6 +502,9 @@ get_available_lmb(struct options *opts, struct dr_node *start_lmb) if ((strcmp(lmb->drc_name, opts->usr_drc_name)) && (lmb->drc_index != drc_index)) continue; + } else if (opts->usr_drc_index) { + if (lmb->drc_index != opts->usr_drc_index) + continue; } if (lmb->unusable) -- 2.1.0 |
From: Nathan F. <nf...@li...> - 2015-04-13 17:09:40
|
Version 1.2.25 of powerpc-utils has been released. See changelog below for what has been included, which is basically everything that has been submitted. Thanks, -Nathan powerpc-utils-1.2.25 ===================================================================== commit 948bbf83b43c9a3bc00f521326e096ca6c7848c5 Author: Bharata B Rao <bh...@li...> Date: Mon Apr 13 11:20:00 2015 -0500 drmgr: Fix CPU/LMB add/removal using drc_index This patch fixes a few things: - Removing a CPU using drc_index is currently removing wrong CPU since CPU removal code doesn't lookup CPU by index. Introduce a routine to lookup by index and ensure that it gets used from the removal path. - get_cpu_by_name() does an implicit looking up of index also. Fix this. - drmgr -s option can mean both drc_index and drc_name. In case of drc_index, rtas_errd will invoke drmgr without -q option which results in no CPU or LMB being added. Make 1 as the default count of CPUs unconditionally which applies to both the cases. After these fixes, I am able to get CPU hotplug and removal working with QEMU on a PowerKVM host. Signed-off-by: Bharata B Rao <bh...@li...> commit 7f1ba6f2cefbc72112ee809d2b5fd90e7525417d Author: Mamatha Inamdar <mam...@li...> Date: Tue Mar 31 18:27:06 2015 -0400 drmgr: Fix to check for drmgr REPLACE (-R) flag In drmgr command drmgr -R (REPLACE) flag check was missing, so this patch is to fix drmgr -R flag in valid_pci_options() interface. ************************************************* Test results: before fixing the patch: The '-r', '-a', or '-i' option must be spcified for PCI operation After fixing the patch: The specified PCI slot is either invalid or does not support hot plug operations.xing the patch: ************************************************************** Signed-off-by: Mamatha Inamdar <mam...@li...> commit a941cdfb9609bba04c5bad18ab8af1c85b7b6a9b Author: Tyrel Datwyler <ty...@li...> Date: Tue Mar 31 18:23:59 2015 -0400 drmgr: Use sysfs migration store to initiate migration when possible The sysfs attribute /sys/kernel/mobility/migration has been present for sometime, but never actually used by drmgr. It can be used to initiate a migration operation in place of the existing faux ibm,supsend-me rtas call. Further, newer kernels are capable of doing the device tree update. We can test the /sys/kernel/mobility/api_version attribute to determine the course of action drmgr should take. Newer kernels will return 1 indicating the kernel is cabable of performing the migration and postmobility fixups. If the attribute is unreadable or returns 0 drmgr should resort to initiatin the migration via rtas, and communicate the post mobility device tree update through the /proc/ppc64/ofdt interface to the kernel. Signed-off-by: Tyrel Datwyler <ty...@li...> commit 62edbba0a29851db8089650e122facb95f40d317 Author: Henish Patel <hp...@li...> Date: Wed Mar 11 21:34:32 2015 -0500 snap: Restrict the usage of snap on RHEL 7 onwards snap is not supported on the RHEL 7 onwards, because we have integrated snap functionality in sosreport. So this patch displays a suitable message. RHEL 7+ users can use sosreport to collect log data. Signed-off-by: Henish Patel <hp...@li...> commit 63f9d99136c0630008cbb5fd241f46d6618e9b1b Author: Nathan Fontenot <nf...@li...> Date: Fri Feb 13 10:15:44 2015 -0500 ppc64_cpu: Initial man page. Initial man page for the ppc64_cpu command. Signed-off-by: Nathan Fontenot <nf...@li...> commit cb0c5c844b384b335cf50e92e20a080b5364e186 Author: Paulo Flabiano Smorigo <pfs...@li...> Date: Fri Feb 13 10:13:03 2015 -0500 Add systemd unit (smt_off) to control smt status. This patch add a --with-systemd attribute to install a systemd unit to turn smt on or off (permanently or not). After it's installed you can use systemd commands like: status, start, stop, enable and disable to control it. Signed-off-by: Paulo Flabiano Smorigo <pfs...@li...> commit acfa92352e3b2bddf256de23e7ef07ad3a47ec08 Author: Thomas Falcon <tlf...@li...> Date: Wed Jan 7 15:05:45 2015 -0500 drmgr/lsslot: Fix broken memory support for little endian Commit 493bfdda30b61be46d7d71e5e7bb05df9334ba81 should have removed some endian conversions included in previous commit. Unfortunately, they were not removed, causing problems when hotplugging memory. This patch removes those endian conversions. Signed-off-by: Thomas Falcon <tlf...@li...> |
From: Nathan F. <nf...@li...> - 2015-04-13 17:06:46
|
Applied. Thanks, -Nathan On 04/06/2015 11:01 PM, Bharata B Rao wrote: > From: Bharata B Rao <bh...@li...> > > This patch fixes a few things: > > - Removing a CPU using drc_index is currently removing wrong CPU since > CPU removal code doesn't lookup CPU by index. Introduce a routine to > lookup by index and ensure that it gets used from the removal path. > - get_cpu_by_name() does an implicit looking up of index also. Fix this. > - drmgr -s option can mean both drc_index and drc_name. In case of > drc_index, rtas_errd will invoke drmgr without -q option which results > in no CPU or LMB being added. Make 1 as the default count of > CPUs unconditionally which applies to both the cases. > > After these fixes, I am able to get CPU hotplug and removal working > with QEMU on a PowerKVM host. > > Signed-off-by: Bharata B Rao <bh...@li...> > --- > src/drmgr/drslot_chrp_cpu.c | 44 ++++++++++++++++++++++++++++++++++++-------- > src/drmgr/drslot_chrp_mem.c | 2 +- > 2 files changed, 37 insertions(+), 9 deletions(-) > > diff --git a/src/drmgr/drslot_chrp_cpu.c b/src/drmgr/drslot_chrp_cpu.c > index e6f185d..54fc576 100644 > --- a/src/drmgr/drslot_chrp_cpu.c > +++ b/src/drmgr/drslot_chrp_cpu.c > @@ -44,16 +44,25 @@ static struct dr_node * > get_cpu_by_name(struct dr_info *drinfo, const char *name) > { > struct dr_node *cpu; > - uint32_t drc_index; > > for (cpu = drinfo->all_cpus; cpu; cpu = cpu->next) { > - if (strcmp(cpu->drc_name, name) == 0) > + if (strcmp(cpu->drc_name, name) == 0) { > break; > + } > + } > > - /* See if the drc index was specified */ > - drc_index = strtoul(name, NULL, 0); > - if (cpu->drc_index == drc_index) > + return cpu; > +} > + > +static struct dr_node * > +get_cpu_by_index(struct dr_info *drinfo, uint32_t index) > +{ > + struct dr_node *cpu; > + > + for (cpu = drinfo->all_cpus; cpu; cpu = cpu->next) { > + if (cpu->drc_index == index) { > break; > + } > } > > return cpu; > @@ -105,6 +114,13 @@ get_available_cpu(struct options *opts, struct dr_info *dr_info) > opts->usr_drc_name); > > return cpu; > + } else if (opts->usr_drc_index) { > + cpu = get_cpu_by_index(dr_info, opts->usr_drc_index); > + if (!cpu) > + say(ERROR, "Could not locate cpu %x\n", > + opts->usr_drc_index); > + > + return cpu; > } > > switch (opts->action) { > @@ -261,6 +277,7 @@ static int > smt_threads_func(struct options *opts, struct dr_info *dr_info) > { > int rc; > + struct dr_node *cpu; > > if (opts->quantity != 1) { > say(ERROR, "Quantity option '-q' may not be specified with " > @@ -274,8 +291,6 @@ smt_threads_func(struct options *opts, struct dr_info *dr_info) > } > > if (opts->usr_drc_name) { > - struct dr_node *cpu; > - > cpu = get_cpu_by_name(dr_info, opts->usr_drc_name); > if (cpu == NULL) { > say(ERROR, "Could not find cpu %s\n", > @@ -288,6 +303,19 @@ smt_threads_func(struct options *opts, struct dr_info *dr_info) > else if (opts->action == REMOVE) > rc = cpu_disable_smt(cpu); > > + } else if (opts->usr_drc_index) { > + cpu = get_cpu_by_index(dr_info, opts->usr_drc_index); > + if (cpu == NULL) { > + say(ERROR, "Could not find cpu %x\n", > + opts->usr_drc_index); > + return -1; > + } > + > + if (opts->action == ADD) > + rc = cpu_enable_smt(cpu, dr_info); > + else if (opts->action == REMOVE) > + rc = cpu_disable_smt(cpu); > + > } else { /* no drc name given, action is system-wide */ > if (opts->action == ADD) > rc = system_enable_smt(dr_info); > @@ -302,7 +330,7 @@ int > valid_cpu_options(struct options *opts) > { > /* default to a quantity of 1 */ > - if ((opts->quantity == 0) && (opts->usr_drc_name == NULL)) > + if ((opts->quantity == 0)) > opts->quantity = 1; > > if ((opts->action != ADD) && (opts->action != REMOVE)) { > diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c > index d6ece97..136219e 100644 > --- a/src/drmgr/drslot_chrp_mem.c > +++ b/src/drmgr/drslot_chrp_mem.c > @@ -1211,7 +1211,7 @@ int > valid_mem_options(struct options *opts) > { > /* default to a quantity of 1 */ > - if ((opts->quantity == 0) && (opts->usr_drc_name == NULL)) > + if (opts->quantity == 0) > opts->quantity = 1; > > if ((opts->action != ADD) && (opts->action != REMOVE)) { > |
From: Nathan F. <nf...@li...> - 2015-04-09 01:25:33
|
On 04/08/2015 04:17 PM, Paul Clarke wrote: > Is there documentation that needs to be updated as well? Ahhh... yes. I should have updated the lsslot man page along with this. Thanks for pointing that out. > > What is "Associativity", "Section(s)"? (What's "LMB" stand for?) The associativity is cpu <=> memory affinity, this tells us which node the memory is on. Section(s) refers to the memory sections in sysfs, i.e. /sys/devices/system/memory/memoryXXX. LMB stands for Logical Memory Block. -Nathan > > On 04/08/2015 02:46 PM, Nathan Fontenot wrote: >> This patch adds additional information to the output produced >> by the lsslot command for dynamic reconfiguration memory. The >> default output with this patch will add the address, drc index, >> and associativity for each LMB. >> >> #> lsslot -c mem >> Dynamic Reconfiguration Memory (LMB size 0x10000000) >> LMB2: >> DRC Index: 80000001 >> Removable: Yes >> Address: 10000000 >> Associativity: 0 0 1 1 >> Section(s): 1 >> -- snip -- > > PC |
From: Paul C. <pc...@us...> - 2015-04-08 21:17:16
|
Is there documentation that needs to be updated as well? What is "Associativity", "Section(s)"? (What's "LMB" stand for?) On 04/08/2015 02:46 PM, Nathan Fontenot wrote: > This patch adds additional information to the output produced > by the lsslot command for dynamic reconfiguration memory. The > default output with this patch will add the address, drc index, > and associativity for each LMB. > > #> lsslot -c mem > Dynamic Reconfiguration Memory (LMB size 0x10000000) > LMB2: > DRC Index: 80000001 > Removable: Yes > Address: 10000000 > Associativity: 0 0 1 1 > Section(s): 1 > -- snip -- PC |
From: Nathan F. <nf...@li...> - 2015-04-08 19:46:59
|
This patch adds additional information to the output produced by the lsslot command for dynamic reconfiguration memory. The default output with this patch will add the address, drc index, and associativity for each LMB. #> lsslot -c mem Dynamic Reconfiguration Memory (LMB size 0x10000000) LMB2: DRC Index: 80000001 Removable: Yes Address: 10000000 Associativity: 0 0 1 1 Section(s): 1 -- snip -- Additionally, this patch allows users to specify the -d 4 option to lsslot for memory which will print information about all possible LMBs, not just the LMBs owned by the system. This patch also adds the ability to print the information for a specific LMB by specifyinf its drc index with the -s option. #> lsslot -c mem -s 0x80000011 Dynamic Reconfiguration Memory (LMB size 0x10000000) LMB18: DRC Index: 80000011 Removable: Yes Address: 110000000 Associativity: 0 0 1 1 Section(s): 17 Signed-off-by: Nathan Fontenot <nf...@li...> --- diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c index ef16e93..9176eeb 100644 --- a/src/drmgr/drslot_chrp_mem.c +++ b/src/drmgr/drslot_chrp_mem.c @@ -313,6 +313,7 @@ get_dynamic_reconfig_lmbs(struct lmb_list_head *lmb_list) sprintf(lmb->ofdt_path, DYNAMIC_RECONFIG_MEM); lmb->lmb_size = lmb_sz; lmb->lmb_address = be64toh(drmem->address); + lmb->lmb_aa_index = be32toh(drmem->assoc_index); if (be32toh(drmem->flags) & DRMEM_ASSIGNED) { found++; diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c index 22d1346..ea46722 100644 --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -699,8 +699,86 @@ lsslot_chrp_phb(struct cmd_opts *opts) return 0; } +int print_drconf_mem(struct cmd_opts *opts, struct lmb_list_head *lmb_list) +{ + struct dr_node *lmb; + struct mem_scn *scn; + int scn_offset = strlen("/sys/devices/system/memory/memory"); + char *aa_buf; + __be32 *aa; + int aa_size, aa_list_sz; + int i, rc; + uint32_t drc_index = 0; + + aa_size = get_property_size(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays"); + aa_buf = zalloc(aa_size); + rc = get_property(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays", aa_buf, aa_size); + if (rc) { + say(ERROR, "Could not get associativity information.\n"); + return -1; + } + + aa = (__be32 *)aa_buf; + /* skip past the number of associativity lists */ + aa++; + aa_list_sz = be32toh(*aa++); + + if (opts->s_name) + drc_index = strtol(opts->s_name, NULL, 0); + + printf("Dynamic Reconfiguration Memory (LMB size 0x%x)\n", + lmb_list->lmbs->lmb_size); + + for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { + int first = 1; + int aa_start, aa_end; + + if (drc_index && drc_index != lmb->drc_index) + continue; + else if ((output_level < 4) && !lmb->is_owned) + continue; + + printf("%s: %s\n", lmb->drc_name, + lmb->is_owned ? "" : "Not Owned"); + + printf(" DRC Index: %x\n", lmb->drc_index); + printf(" Removable: %s\n", lmb->is_removable ? "Yes" : "No"); + printf(" Address: %lx\n", lmb->lmb_address); + printf(" Associativity: "); + if (lmb->lmb_aa_index == 0xffffffff) { + printf("Not Set\n"); + } else { + aa_start = lmb->lmb_aa_index * aa_list_sz; + aa_end = aa_start + aa_list_sz; + for (i = aa_start; i < aa_end; i++) + printf("%d ", be32toh(aa[i])); + printf("\n"); + } + + if (lmb->is_owned) { + printf(" Section(s): "); + for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { + if (first) { + printf(" %s", + &scn->sysfs_path[scn_offset]); + first = 0; + } else + printf(", %s", + &scn->sysfs_path[scn_offset]); + } + + printf("\n"); + } + } + + free(aa_buf); + return 0; +} + int -lsslot_chrp_mem(void) +lsslot_chrp_mem(struct cmd_opts *opts) { struct lmb_list_head *lmb_list; struct dr_node *lmb; @@ -712,40 +790,40 @@ lsslot_chrp_mem(void) if (lmb_list == NULL || lmb_list->lmbs == NULL) return -1; - printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size); if (lmb_list->drconf_buf) { - printf("ibm,dynamic-reconfiguration-memory\n"); - printf("%-5s %c %s\n", "Name", 'R', "Sections"); - printf("%-5s %c %s\n", "----", '-', "--------"); + print_drconf_mem(opts, lmb_list); } else { + printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size); printf("%-20s %-5s %c %s\n", "Memory Node", "Name", 'R', "Sections"); printf("%-20s %-5s %c %s\n", "-----------", "----", '-', "--------"); - } - for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { - int first = 1; + for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { + int first = 1; - if (!lmb->is_owned) - continue; + if (!lmb->is_owned) + continue; - if (!lmb_list->drconf_buf) - printf("%-20s ", &lmb->ofdt_path[lmb_offset]); + if (!lmb_list->drconf_buf) + printf("%-20s ", &lmb->ofdt_path[lmb_offset]); - printf("%-5s %c ", lmb->drc_name, - lmb->is_removable ? 'Y' : 'N'); + printf("%-5s %c ", lmb->drc_name, + lmb->is_removable ? 'Y' : 'N'); - for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { - if (first) { - printf(" %s", &scn->sysfs_path[scn_offset]); - first = 0; - } else - printf(", %s", &scn->sysfs_path[scn_offset]); - } + for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { + if (first) { + printf(" %s", + &scn->sysfs_path[scn_offset]); + first = 0; + } else + printf(", %s", + &scn->sysfs_path[scn_offset]); + } - printf("\n"); + printf("\n"); + } } free_lmbs(lmb_list); @@ -888,7 +966,7 @@ main(int argc, char *argv[]) break; case MEM: - rc = lsslot_chrp_mem(); + rc = lsslot_chrp_mem(&opts); break; case PORT: diff --git a/src/drmgr/ofdt.h b/src/drmgr/ofdt.h index 954377b..c728507 100644 --- a/src/drmgr/ofdt.h +++ b/src/drmgr/ofdt.h @@ -77,12 +77,14 @@ struct dr_node { struct mem_info { uint64_t _address; uint32_t _lmb_size; + uint32_t _lmb_aa_index; struct mem_scn *_mem_scns; struct of_node *_of_node; } _smem; #define lmb_address _node_u._smem._address #define lmb_size _node_u._smem._lmb_size +#define lmb_aa_index _node_u._smem._lmb_aa_index #define lmb_mem_scns _node_u._smem._mem_scns #define lmb_of_node _node_u._smem._of_node |
From: Bharata B R. <bha...@gm...> - 2015-04-07 04:02:23
|
From: Bharata B Rao <bh...@li...> This patch fixes a few things: - Removing a CPU using drc_index is currently removing wrong CPU since CPU removal code doesn't lookup CPU by index. Introduce a routine to lookup by index and ensure that it gets used from the removal path. - get_cpu_by_name() does an implicit looking up of index also. Fix this. - drmgr -s option can mean both drc_index and drc_name. In case of drc_index, rtas_errd will invoke drmgr without -q option which results in no CPU or LMB being added. Make 1 as the default count of CPUs unconditionally which applies to both the cases. After these fixes, I am able to get CPU hotplug and removal working with QEMU on a PowerKVM host. Signed-off-by: Bharata B Rao <bh...@li...> --- src/drmgr/drslot_chrp_cpu.c | 44 ++++++++++++++++++++++++++++++++++++-------- src/drmgr/drslot_chrp_mem.c | 2 +- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/drmgr/drslot_chrp_cpu.c b/src/drmgr/drslot_chrp_cpu.c index e6f185d..54fc576 100644 --- a/src/drmgr/drslot_chrp_cpu.c +++ b/src/drmgr/drslot_chrp_cpu.c @@ -44,16 +44,25 @@ static struct dr_node * get_cpu_by_name(struct dr_info *drinfo, const char *name) { struct dr_node *cpu; - uint32_t drc_index; for (cpu = drinfo->all_cpus; cpu; cpu = cpu->next) { - if (strcmp(cpu->drc_name, name) == 0) + if (strcmp(cpu->drc_name, name) == 0) { break; + } + } - /* See if the drc index was specified */ - drc_index = strtoul(name, NULL, 0); - if (cpu->drc_index == drc_index) + return cpu; +} + +static struct dr_node * +get_cpu_by_index(struct dr_info *drinfo, uint32_t index) +{ + struct dr_node *cpu; + + for (cpu = drinfo->all_cpus; cpu; cpu = cpu->next) { + if (cpu->drc_index == index) { break; + } } return cpu; @@ -105,6 +114,13 @@ get_available_cpu(struct options *opts, struct dr_info *dr_info) opts->usr_drc_name); return cpu; + } else if (opts->usr_drc_index) { + cpu = get_cpu_by_index(dr_info, opts->usr_drc_index); + if (!cpu) + say(ERROR, "Could not locate cpu %x\n", + opts->usr_drc_index); + + return cpu; } switch (opts->action) { @@ -261,6 +277,7 @@ static int smt_threads_func(struct options *opts, struct dr_info *dr_info) { int rc; + struct dr_node *cpu; if (opts->quantity != 1) { say(ERROR, "Quantity option '-q' may not be specified with " @@ -274,8 +291,6 @@ smt_threads_func(struct options *opts, struct dr_info *dr_info) } if (opts->usr_drc_name) { - struct dr_node *cpu; - cpu = get_cpu_by_name(dr_info, opts->usr_drc_name); if (cpu == NULL) { say(ERROR, "Could not find cpu %s\n", @@ -288,6 +303,19 @@ smt_threads_func(struct options *opts, struct dr_info *dr_info) else if (opts->action == REMOVE) rc = cpu_disable_smt(cpu); + } else if (opts->usr_drc_index) { + cpu = get_cpu_by_index(dr_info, opts->usr_drc_index); + if (cpu == NULL) { + say(ERROR, "Could not find cpu %x\n", + opts->usr_drc_index); + return -1; + } + + if (opts->action == ADD) + rc = cpu_enable_smt(cpu, dr_info); + else if (opts->action == REMOVE) + rc = cpu_disable_smt(cpu); + } else { /* no drc name given, action is system-wide */ if (opts->action == ADD) rc = system_enable_smt(dr_info); @@ -302,7 +330,7 @@ int valid_cpu_options(struct options *opts) { /* default to a quantity of 1 */ - if ((opts->quantity == 0) && (opts->usr_drc_name == NULL)) + if ((opts->quantity == 0)) opts->quantity = 1; if ((opts->action != ADD) && (opts->action != REMOVE)) { diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c index d6ece97..136219e 100644 --- a/src/drmgr/drslot_chrp_mem.c +++ b/src/drmgr/drslot_chrp_mem.c @@ -1211,7 +1211,7 @@ int valid_mem_options(struct options *opts) { /* default to a quantity of 1 */ - if ((opts->quantity == 0) && (opts->usr_drc_name == NULL)) + if (opts->quantity == 0) opts->quantity = 1; if ((opts->action != ADD) && (opts->action != REMOVE)) { -- 2.1.0 |
From: Mamatha I. <mam...@li...> - 2015-03-27 05:36:47
|
On 03/26/2015 11:39 PM, Nathan Fontenot wrote: > On 03/16/2015 05:28 AM, Mamatha Inamdar wrote: >> In drmgr command drmgr -R (REPLACE) flag check was missing, so >> this patch is to fix drmgr -R flag in valid_pci_options() interface. >> >> ************************************************* >> Test results: >> >> before fixing the patch: >> # drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R >> The '-r', '-a', or '-i' option must be spcified for PCI operation >> >> After fixing the patch: >> >> # ./src/drmgr/drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R >> The specified PCI slot is either invalid >> or does not support hot plug operations.xing the patch: >> ************************************************************** >> >> Signed-off-by: Mamatha Inamdar <mam...@li...> >> --- >> 0 files changed >> >> diff --git a/src/drmgr/drslot_chrp_pci.c b/src/drmgr/drslot_chrp_pci.c >> index 0c8de2f..1f9f994 100644 >> --- a/src/drmgr/drslot_chrp_pci.c >> +++ b/src/drmgr/drslot_chrp_pci.c >> @@ -855,7 +855,7 @@ valid_pci_options(struct options *opts) >> } >> >> if ((opts->action != ADD) && (opts->action != REMOVE) >> - && (opts->action != IDENTIFY)) { >> + && (opts->action != IDENTIFY) && (opts->action != REPLACE)) { >> say(ERROR, "The '-r', '-a', or '-i' option must be spcified " >> "for PCI operations\n"); > We should also update the error message to include -R. > > -Nathan Thanks Nathan, Updated error message and sent new version of patch > >> return -1; >> >> >> ------------------------------------------------------------------------------ >> Dive into the World of Parallel Programming The Go Parallel Website, sponsored >> by Intel and developed in partnership with Slashdot Media, is your hub for all >> things parallel software development, from weekly thought leadership blogs to >> news, videos, case studies, tutorials and more. Take a look and join the >> conversation now. http://goparallel.sourceforge.net/ >> _______________________________________________ >> Powerpc-utils-devel mailing list >> Pow...@li... >> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel >> |
From: Mamatha I. <mam...@li...> - 2015-03-27 05:34:45
|
In drmgr command drmgr -R (REPLACE) flag check was missing, so this patch is to fix drmgr -R flag in valid_pci_options() interface. ************************************************* Test results: before fixing the patch: # drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R The '-r', '-a', or '-i' option must be spcified for PCI operation After fixing the patch: # ./src/drmgr/drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R The specified PCI slot is either invalid or does not support hot plug operations.xing the patch: ************************************************************** Signed-off-by: Mamatha Inamdar <mam...@li...> --- src/drmgr/drslot_chrp_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drmgr/drslot_chrp_pci.c b/src/drmgr/drslot_chrp_pci.c index 0c8de2f..d3873c7 100644 --- a/src/drmgr/drslot_chrp_pci.c +++ b/src/drmgr/drslot_chrp_pci.c @@ -855,8 +855,8 @@ valid_pci_options(struct options *opts) } if ((opts->action != ADD) && (opts->action != REMOVE) - && (opts->action != IDENTIFY)) { - say(ERROR, "The '-r', '-a', or '-i' option must be spcified " + && (opts->action != IDENTIFY) && (opts->action != REPLACE)) { + say(ERROR, "The '-r', '-a', '-R' or '-i' option must be spcified " "for PCI operations\n"); return -1; } |
From: Nathan F. <nf...@li...> - 2015-03-26 18:09:13
|
On 03/16/2015 05:28 AM, Mamatha Inamdar wrote: > In drmgr command drmgr -R (REPLACE) flag check was missing, so > this patch is to fix drmgr -R flag in valid_pci_options() interface. > > ************************************************* > Test results: > > before fixing the patch: > # drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R > The '-r', '-a', or '-i' option must be spcified for PCI operation > > After fixing the patch: > > # ./src/drmgr/drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R > The specified PCI slot is either invalid > or does not support hot plug operations.xing the patch: > ************************************************************** > > Signed-off-by: Mamatha Inamdar <mam...@li...> > --- > 0 files changed > > diff --git a/src/drmgr/drslot_chrp_pci.c b/src/drmgr/drslot_chrp_pci.c > index 0c8de2f..1f9f994 100644 > --- a/src/drmgr/drslot_chrp_pci.c > +++ b/src/drmgr/drslot_chrp_pci.c > @@ -855,7 +855,7 @@ valid_pci_options(struct options *opts) > } > > if ((opts->action != ADD) && (opts->action != REMOVE) > - && (opts->action != IDENTIFY)) { > + && (opts->action != IDENTIFY) && (opts->action != REPLACE)) { > say(ERROR, "The '-r', '-a', or '-i' option must be spcified " > "for PCI operations\n"); We should also update the error message to include -R. -Nathan > return -1; > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > |
From: Tyrel D. <ty...@li...> - 2015-03-18 00:21:01
|
The sysfs attribute /sys/kernel/mobility/migration has been present for sometime, but never actually used by drmgr. It can be used to initiate a migration operation in place of the existing faux ibm,supsend-me rtas call. Further, newer kernels are capable of doing the device tree update. We can test the /sys/kernel/mobility/api_version attribute to determine the course of action drmgr should take. Newer kernels will return 1 indicating the kernel is cabable of performing the migration and postmobility fixups. If the attribute is unreadable or returns 0 drmgr should resort to initiating the migration via rtas, and communicate the post mobility device tree update through the /proc/ppc64/ofdt interface to the kernel. Signed-off-by: Tyrel Datwyler <ty...@li...> --- src/drmgr/drmig_chrp_pmig.c | 56 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/src/drmgr/drmig_chrp_pmig.c b/src/drmgr/drmig_chrp_pmig.c index a7c1ec5..8e8f9d0 100644 --- a/src/drmgr/drmig_chrp_pmig.c +++ b/src/drmgr/drmig_chrp_pmig.c @@ -28,6 +28,13 @@ struct pmap_struct { }; #define SYSFS_HIBERNATION_FILE "/sys/devices/system/power/hibernate" +#define SYSFS_MIGRATION_FILE "/sys/kernel/mobility/migration" +#define SYSFS_MIGRATION_API_FILE "/sys/kernel/mobility/api_version" + +/* drmgr must call ibm,suspend-me and is responsible for postmobility fixups */ +#define MIGRATION_API_V0 0 +/* drmgr must write to sysfs migration store and allow kernel to do postmobility fixups */ +#define MIGRATION_API_V1 1 static struct pmap_struct *plist; static int action = 0; @@ -559,11 +566,48 @@ valid_pmig_options(struct options *opts) int do_migration(uint64_t stream_val) { - int rc; + int rc, fd; + int api_level = 0; + char buf[64]; + + /* If the kernel can also do the device tree update we should let the kernel do all the work. + Check if sysfs migration api_version is readable and use api level to determine how to + perform migration and post-mobility updates. */ + rc = get_int_attribute(SYSFS_MIGRATION_API_FILE, NULL, &api_level, sizeof(&api_level)); + if (rc) + say(DEBUG,"get_int_attribute returned %d for path %s\n", rc, SYSFS_MIGRATION_API_FILE); + + if (api_level == MIGRATION_API_V0) { + say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); + rc = rtas_suspend_me(stream_val); + say(DEBUG, "ibm,suspend-me() returned %d\n", rc); + } else if (api_level == MIGRATION_API_V1) { + sprintf(buf, "0x%llx\n", stream_val); + + fd = open(SYSFS_MIGRATION_FILE, O_WRONLY); + if (fd == -1) { + say(ERROR, "Could not open \"%s\" to initiate migration, " + "%m\n", SYSFS_MIGRATION_FILE); + return -1; + } + + say(DEBUG, "Initiating migration via %s with %s\n", + SYSFS_MIGRATION_FILE, buf); + + rc = write(fd, buf, strlen(buf)); + if (rc < 0) { + say(DEBUG, "Write to migration file failed with rc: %d\n", rc); + rc = errno; + } else if (rc > 0) + rc = 0; + + close(fd); + say(DEBUG, "Kernel migration returned %d\n", rc); + } else { + say(ERROR, "Unknown kernel migration api version %d\n", api_level); + rc = -1; + } - say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); - rc = rtas_suspend_me(stream_val); - say(DEBUG, "ibm,suspend-me() returned %d\n", rc); return rc; } @@ -604,9 +648,9 @@ void post_mobility_update(int action) char *path; if (action == HIBERNATE) - path = "/sys/devices/system/power/hibernate"; + path = SYSFS_HIBERNATION_FILE; else - path = "/sys/kernel/mobility/migrate"; + path = SYSFS_MIGRATION_API_FILE; /* kernel will return 0 or sysfs attribute will be unreadable if drmgr needs to perform a device tree update */ -- 1.7.12.2 |
From: Mamatha I. <mam...@li...> - 2015-03-16 10:29:38
|
In drmgr command drmgr -R (REPLACE) flag check was missing, so this patch is to fix drmgr -R flag in valid_pci_options() interface. ************************************************* Test results: before fixing the patch: # drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R The '-r', '-a', or '-i' option must be spcified for PCI operation After fixing the patch: # ./src/drmgr/drmgr -c pci -s U78CD.001.FZH0003-P2-C3 -R The specified PCI slot is either invalid or does not support hot plug operations.xing the patch: ************************************************************** Signed-off-by: Mamatha Inamdar <mam...@li...> --- 0 files changed diff --git a/src/drmgr/drslot_chrp_pci.c b/src/drmgr/drslot_chrp_pci.c index 0c8de2f..1f9f994 100644 --- a/src/drmgr/drslot_chrp_pci.c +++ b/src/drmgr/drslot_chrp_pci.c @@ -855,7 +855,7 @@ valid_pci_options(struct options *opts) } if ((opts->action != ADD) && (opts->action != REMOVE) - && (opts->action != IDENTIFY)) { + && (opts->action != IDENTIFY) && (opts->action != REPLACE)) { say(ERROR, "The '-r', '-a', or '-i' option must be spcified " "for PCI operations\n"); return -1; |
From: Nathan F. <nf...@li...> - 2015-03-12 02:36:05
|
Applied. -Nathan On 02/25/2015 08:52 AM, Henish Patel wrote: > snap is not supported on the RHEL 7 onwards, because we have integrated snap > functionality in sosreport. So this patch displays a suitable message. > RHEL 7+ users can use sosreport to collect log data. > > Signed-off-by: Henish Patel <hp...@li...> > --- > scripts/snap | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/scripts/snap b/scripts/snap > index a3eb8c7..dc8abe1 100755 > --- a/scripts/snap > +++ b/scripts/snap > @@ -34,7 +34,19 @@ my $outfile = "snap.tar.gz"; # in the working dir. > my $cmddir = "snap_commands"; # cmd output dir. > my $cmdoutdir = "$outdir/$cmddir"; # in outdir dir. > my $rsxx_exists = 0; # Does an IBM Flash Adapter exist? > -my $distro_file = "/etc/issue" > +my $distro_file = "/etc/issue"; > +my $redhat_release_file = "/etc/redhat-release"; > + > +if (-e $redhat_release_file) { > + open(RELEASE, "< $redhat_release_file") or die "open: $!\n"; > + $_ = <RELEASE>; > + my $redhat_version = (split / /, $_)[6]; > + if ($redhat_version >= 7.0) { > + print "snap is not supported on the RHEL 7 onwards..!\n"; > + print "Please use sosreport to collect log data..!! \n"; > + exit 1; > + } > +} > > our($opt_a, $opt_d, $opt_h, $opt_o, $opt_t, $opt_v); > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > |
From: Nathan F. <nf...@li...> - 2015-03-12 01:39:54
|
Applied. -Nathan On 03/09/2015 01:29 PM, Thomas Falcon wrote: > Due to security concerns, data to be sent over the network > will be serialized via json instead of pickle. The socket file > interface will also be removed as it did not play nice with the > json load method. Data transfers will be implemented with the > socket send, sendall, and recv methods. These implementations along with > json serialization are contained within the functions send_json_message > and receive_json_message, which allow the client and server to transfer > json messages of variable size. > > Signed-off-by: Thomas Falcon <tlf...@li...> > --- > scripts/amsvis/powerpcAMS/amsnet.py | 46 ++++++++++++++++++------------------- > 1 file changed, 22 insertions(+), 24 deletions(-) > > diff --git a/scripts/amsvis/powerpcAMS/amsnet.py b/scripts/amsvis/powerpcAMS/amsnet.py > index 0e721df..ed460f9 100644 > --- a/scripts/amsvis/powerpcAMS/amsnet.py > +++ b/scripts/amsvis/powerpcAMS/amsnet.py > @@ -1,4 +1,4 @@ > -"""Network client/server for transmitting pickled data. > +"""Network client/server for transmitting json data. > """ > > __author__ = "Robert Jennings rc...@li..." > @@ -8,7 +8,7 @@ __license__ = "Common Public License v1.0" > import socket > import types > import logging > -import cPickle as pickle > +import json > > from powerpcAMS.amsdata import gather_all_data, gather_system_data > > @@ -23,9 +23,22 @@ DATA_METHODS = (gather_all_data, gather_system_data) > # backwards compatibility is broken. > CMDVERS = 1.0000000 > > +def send_json_message(socket, message): > + json_message = json.dumps(message) > + socket.send("%d\n" % len(json_message)) > + socket.sendall(json_message) > + > +def receive_json_message(socket): > + len_str = '' > + while True: > + c = socket.recv(1) > + if c == '\n': break > + len_str += c > + mesg_len = int(len_str) > + return json.loads(socket.recv(mesg_len)) > > def send_data_loop(port): > - """Send pickled data to any client that connects to a given network port. > + """Send json data to any client that connects to a given network port. > > Keyword arguments: > port -- network port number to use for this server > @@ -40,7 +53,6 @@ def send_data_loop(port): > logging.error("Network error: (%d) " % errno + errstr) > return 1 > > - sockfile = None > conn = None > > try: > @@ -48,7 +60,6 @@ def send_data_loop(port): > sock.listen(1) > (conn, addr) = sock.accept() > logging.debug("Client connected from " + repr(addr)) > - sockfile = conn.makefile('rwb', 0) > > result = "success" > data = None > @@ -58,7 +69,7 @@ def send_data_loop(port): > # request data version we can change what the server will > # send in the future. > try: > - client_data = pickle.Unpickler(sockfile).load() > + client_data = receive_json_message(conn) > except: > logging.debug("Unable to parse client request.") > logging.info("Bad client request, ignoring.") > @@ -87,7 +98,7 @@ def send_data_loop(port): > if result is not "error": > data_method = DATA_METHODS[client_data["command"]] > > - # Gather system data and send pickled objects to the client > + # Gather system data and send json objects to the client > data = data_method() > if data is None: > result = "error" > @@ -95,19 +106,14 @@ def send_data_loop(port): > logging.debug("Sending %d data objects to client.", len(data)) > > response = {"result": result, "data": data} > - sockfile.writelines(pickle.dumps(response, -1)) > > + send_json_message(conn, response) > # Clean up > - sockfile.close() > - sockfile = None > - > conn.close() > conn = None > > # Catch a keyboard interrupt by cleaning up the socket > except KeyboardInterrupt: > - if sockfile: > - sockfile.close() > if conn: > conn.close() > sock.close() > @@ -116,8 +122,6 @@ def send_data_loop(port): > > # Catch a network error and clean up, return 1 to indicate an error > except socket.error, msg: > - if sockfile: > - sockfile.close() > if conn: > conn.close() > sock.close() > @@ -127,8 +131,6 @@ def send_data_loop(port): > > # Give the user something slightly helpful for any other error > except: > - if sockfile: > - sockfile.close() > if conn: > conn.close() > sock.close() > @@ -138,7 +140,7 @@ def send_data_loop(port): > > # Client > def net_get_data(host="localhost", port=50000, cmd=CMD_GET_ALL_DATA): > - """Get pickled data from a simple network server. > + """Get json data from a simple network server. > > Keywork arguments: > host -- server host name (default localhost) > @@ -161,8 +163,6 @@ def net_get_data(host="localhost", port=50000, cmd=CMD_GET_ALL_DATA): > "data": "Client: Is the server still running?", > } > > - sockfile = sock.makefile('rwb', 0) # read/write, unbuffered > - > # By sending a request to the server, including a version for the data > # request, we can change the data sent by the server in the future. > if type(cmd) is types.IntType and cmd >= 0 and cmd <= CMD_MAX: > @@ -179,15 +179,13 @@ def net_get_data(host="localhost", port=50000, cmd=CMD_GET_ALL_DATA): > "data": "Client: Bad request.", > } > > - sockfile.writelines(pickle.dumps(client_request, -1)) > + send_json_message(sock, client_request) > > # Get server response > - pickler = pickle.Unpickler(sockfile) > try: > - data = pickler.load() > + data = receive_json_message(sock) > except EOFError: > pass > - sockfile.close() > sock.close() > > if type(data) is not types.DictType or "result" not in data: > |
From: Thomas F. <tlf...@li...> - 2015-03-09 18:30:04
|
Due to security concerns, data to be sent over the network will be serialized via json instead of pickle. The socket file interface will also be removed as it did not play nice with the json load method. Data transfers will be implemented with the socket send, sendall, and recv methods. These implementations along with json serialization are contained within the functions send_json_message and receive_json_message, which allow the client and server to transfer json messages of variable size. Signed-off-by: Thomas Falcon <tlf...@li...> --- scripts/amsvis/powerpcAMS/amsnet.py | 46 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/scripts/amsvis/powerpcAMS/amsnet.py b/scripts/amsvis/powerpcAMS/amsnet.py index 0e721df..ed460f9 100644 --- a/scripts/amsvis/powerpcAMS/amsnet.py +++ b/scripts/amsvis/powerpcAMS/amsnet.py @@ -1,4 +1,4 @@ -"""Network client/server for transmitting pickled data. +"""Network client/server for transmitting json data. """ __author__ = "Robert Jennings rc...@li..." @@ -8,7 +8,7 @@ __license__ = "Common Public License v1.0" import socket import types import logging -import cPickle as pickle +import json from powerpcAMS.amsdata import gather_all_data, gather_system_data @@ -23,9 +23,22 @@ DATA_METHODS = (gather_all_data, gather_system_data) # backwards compatibility is broken. CMDVERS = 1.0000000 +def send_json_message(socket, message): + json_message = json.dumps(message) + socket.send("%d\n" % len(json_message)) + socket.sendall(json_message) + +def receive_json_message(socket): + len_str = '' + while True: + c = socket.recv(1) + if c == '\n': break + len_str += c + mesg_len = int(len_str) + return json.loads(socket.recv(mesg_len)) def send_data_loop(port): - """Send pickled data to any client that connects to a given network port. + """Send json data to any client that connects to a given network port. Keyword arguments: port -- network port number to use for this server @@ -40,7 +53,6 @@ def send_data_loop(port): logging.error("Network error: (%d) " % errno + errstr) return 1 - sockfile = None conn = None try: @@ -48,7 +60,6 @@ def send_data_loop(port): sock.listen(1) (conn, addr) = sock.accept() logging.debug("Client connected from " + repr(addr)) - sockfile = conn.makefile('rwb', 0) result = "success" data = None @@ -58,7 +69,7 @@ def send_data_loop(port): # request data version we can change what the server will # send in the future. try: - client_data = pickle.Unpickler(sockfile).load() + client_data = receive_json_message(conn) except: logging.debug("Unable to parse client request.") logging.info("Bad client request, ignoring.") @@ -87,7 +98,7 @@ def send_data_loop(port): if result is not "error": data_method = DATA_METHODS[client_data["command"]] - # Gather system data and send pickled objects to the client + # Gather system data and send json objects to the client data = data_method() if data is None: result = "error" @@ -95,19 +106,14 @@ def send_data_loop(port): logging.debug("Sending %d data objects to client.", len(data)) response = {"result": result, "data": data} - sockfile.writelines(pickle.dumps(response, -1)) + send_json_message(conn, response) # Clean up - sockfile.close() - sockfile = None - conn.close() conn = None # Catch a keyboard interrupt by cleaning up the socket except KeyboardInterrupt: - if sockfile: - sockfile.close() if conn: conn.close() sock.close() @@ -116,8 +122,6 @@ def send_data_loop(port): # Catch a network error and clean up, return 1 to indicate an error except socket.error, msg: - if sockfile: - sockfile.close() if conn: conn.close() sock.close() @@ -127,8 +131,6 @@ def send_data_loop(port): # Give the user something slightly helpful for any other error except: - if sockfile: - sockfile.close() if conn: conn.close() sock.close() @@ -138,7 +140,7 @@ def send_data_loop(port): # Client def net_get_data(host="localhost", port=50000, cmd=CMD_GET_ALL_DATA): - """Get pickled data from a simple network server. + """Get json data from a simple network server. Keywork arguments: host -- server host name (default localhost) @@ -161,8 +163,6 @@ def net_get_data(host="localhost", port=50000, cmd=CMD_GET_ALL_DATA): "data": "Client: Is the server still running?", } - sockfile = sock.makefile('rwb', 0) # read/write, unbuffered - # By sending a request to the server, including a version for the data # request, we can change the data sent by the server in the future. if type(cmd) is types.IntType and cmd >= 0 and cmd <= CMD_MAX: @@ -179,15 +179,13 @@ def net_get_data(host="localhost", port=50000, cmd=CMD_GET_ALL_DATA): "data": "Client: Bad request.", } - sockfile.writelines(pickle.dumps(client_request, -1)) + send_json_message(sock, client_request) # Get server response - pickler = pickle.Unpickler(sockfile) try: - data = pickler.load() + data = receive_json_message(sock) except EOFError: pass - sockfile.close() sock.close() if type(data) is not types.DictType or "result" not in data: -- 1.8.5.2 |
From: Tyrel D. <ty...@li...> - 2015-03-04 20:08:29
|
On 02/27/2015 06:29 PM, Tyrel Datwyler wrote: > The sysfs attribute /sys/kernel/mobility/migration has been present for > sometime, but never actually used by drmgr. It can be used to initiate a > migration operation in place of the existing faux ibm,supsend-me rtas call. > Further, the kernel is capable of doing the device tree update. > > We can test the "migration" attribute to determine the course of action > drmgr should take. Newer kernels will return 1 indicating the kernel > does the update after a migration. If the attribute is unreadable or > returns 0 drmgr will resort to initiating the migration via rtas, and > communicate the post mobility device tree update through the > /proc/ppc64/ofdt interface to the kernel. > > Signed-off-by: Tyrel Datwyler <ty...@li...> Nathan, Hold off on pulling this patch. The corresponding kernel patch got some push back, and mpe has asked me to change the interface to test if in kernel migration is working to something like "/sys/kernel/mobility/api_version". -Tyrel > --- > src/drmgr/drmig_chrp_pmig.c | 47 +++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 41 insertions(+), 6 deletions(-) > > diff --git a/src/drmgr/drmig_chrp_pmig.c b/src/drmgr/drmig_chrp_pmig.c > index a7c1ec5..9c50df8 100644 > --- a/src/drmgr/drmig_chrp_pmig.c > +++ b/src/drmgr/drmig_chrp_pmig.c > @@ -28,6 +28,7 @@ struct pmap_struct { > }; > > #define SYSFS_HIBERNATION_FILE "/sys/devices/system/power/hibernate" > +#define SYSFS_MIGRATION_FILE "/sys/kernel/mobility/migration" > > static struct pmap_struct *plist; > static int action = 0; > @@ -559,11 +560,45 @@ valid_pmig_options(struct options *opts) > > int do_migration(uint64_t stream_val) > { > - int rc; > + int rc, fd; > + int kern_mobility = 0; > + char buf[64]; > + > + /* If the kernel can also do the device tree update we should let the kernel do all the work. > + Check if sysfs migration file is readable and returns 1. Otherwise, invoke suspend-me via > + rtas and we will do postmobility fixup ourself. */ > + rc = get_int_attribute(SYSFS_MIGRATION_FILE, NULL, &kern_mobility, sizeof(&kern_mobility)); > + if (rc) > + say(DEBUG,"get_int_attribute returned %d for path %s\n", rc, SYSFS_MIGRATION_FILE); > + > + if (!kern_mobility) { > + say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); > + rc = rtas_suspend_me(stream_val); > + say(DEBUG, "ibm,suspend-me() returned %d\n", rc); > + } else { > + sprintf(buf, "0x%llx\n", stream_val); > + > + fd = open(SYSFS_MIGRATION_FILE, O_WRONLY); > + if (fd == -1) { > + say(ERROR, "Could not open \"%s\" to initiate migration, " > + "%m\n", SYSFS_MIGRATION_FILE); > + return -1; > + } > + > + say(DEBUG, "Initiating migration via %s with %s\n", > + SYSFS_MIGRATION_FILE, buf); > + > + rc = write(fd, buf, strlen(buf)); > + if (rc < 0) { > + say(DEBUG, "Write to migration file failed with rc: %d\n", rc); > + rc = errno; > + } else if (rc > 0) > + rc = 0; > + > + close(fd); > + say(DEBUG, "Kernel migration returned %d\n", rc); > + } > > - say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); > - rc = rtas_suspend_me(stream_val); > - say(DEBUG, "ibm,suspend-me() returned %d\n", rc); > return rc; > } > > @@ -604,9 +639,9 @@ void post_mobility_update(int action) > char *path; > > if (action == HIBERNATE) > - path = "/sys/devices/system/power/hibernate"; > + path = SYSFS_HIBERNATION_FILE; > else > - path = "/sys/kernel/mobility/migrate"; > + path = SYSFS_MIGRATION_FILE; > > /* kernel will return 0 or sysfs attribute will be unreadable if drmgr > needs to perform a device tree update */ > |
From: Vasant H. <heg...@li...> - 2015-03-02 06:31:10
|
On 02/26/2015 03:48 PM, Dinar Valeev wrote: > On Thu, Jan 8, 2015 at 6:39 AM, Vasant Hegde > <heg...@li...> wrote: >> On 12/18/2014 03:23 AM, Nathan Fontenot wrote: >>> On 12/14/2014 11:39 PM, Vasant Hegde wrote: >>>> On 12/05/2014 04:11 PM, Henish Patel wrote: >>>>> snap is not supported on the RHEL 7 onwards, because we have integrated snap >>>>> functionality in sosreport. So this patch displays a suitable message on >>>>> usage of snap tool. RHEL 7+ users can use sosreport to collect log data. >>>>> >>>> >>>> Nathan, >>>> >>>> >>>>> Signed-off-by: Henish Patel <hp...@li...> >>>> >>>> As you are aware we are trying to standardize data collection tool rather than >>>> having separate tool for Power.. We have made necessary changes in distro >>>> provided tools (sosreport for RH) to collect required data.. Also any future >>>> changes goes to distro provided tools only.. >>>> >>> >>> Not a problem. >>> >>> Do you know if there is any work to do this same thing for the other distro's? >> >> Yes .. We are planning to deprecate for SLES12 onwards as well.. We have pushed >> all required changes to supportconfig command.. Let me confirm we have everything >> in supportconfig.. Then will send out another patch. > Do you have pull request link handy? Not yet.. Will let you know once we add patch for SLES12 as well. -Vasant |
From: Tyrel D. <ty...@li...> - 2015-02-28 02:30:12
|
The sysfs attribute /sys/kernel/mobility/migration has been present for sometime, but never actually used by drmgr. It can be used to initiate a migration operation in place of the existing faux ibm,supsend-me rtas call. Further, the kernel is capable of doing the device tree update. We can test the "migration" attribute to determine the course of action drmgr should take. Newer kernels will return 1 indicating the kernel does the update after a migration. If the attribute is unreadable or returns 0 drmgr will resort to initiating the migration via rtas, and communicate the post mobility device tree update through the /proc/ppc64/ofdt interface to the kernel. Signed-off-by: Tyrel Datwyler <ty...@li...> --- src/drmgr/drmig_chrp_pmig.c | 47 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/src/drmgr/drmig_chrp_pmig.c b/src/drmgr/drmig_chrp_pmig.c index a7c1ec5..9c50df8 100644 --- a/src/drmgr/drmig_chrp_pmig.c +++ b/src/drmgr/drmig_chrp_pmig.c @@ -28,6 +28,7 @@ struct pmap_struct { }; #define SYSFS_HIBERNATION_FILE "/sys/devices/system/power/hibernate" +#define SYSFS_MIGRATION_FILE "/sys/kernel/mobility/migration" static struct pmap_struct *plist; static int action = 0; @@ -559,11 +560,45 @@ valid_pmig_options(struct options *opts) int do_migration(uint64_t stream_val) { - int rc; + int rc, fd; + int kern_mobility = 0; + char buf[64]; + + /* If the kernel can also do the device tree update we should let the kernel do all the work. + Check if sysfs migration file is readable and returns 1. Otherwise, invoke suspend-me via + rtas and we will do postmobility fixup ourself. */ + rc = get_int_attribute(SYSFS_MIGRATION_FILE, NULL, &kern_mobility, sizeof(&kern_mobility)); + if (rc) + say(DEBUG,"get_int_attribute returned %d for path %s\n", rc, SYSFS_MIGRATION_FILE); + + if (!kern_mobility) { + say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); + rc = rtas_suspend_me(stream_val); + say(DEBUG, "ibm,suspend-me() returned %d\n", rc); + } else { + sprintf(buf, "0x%llx\n", stream_val); + + fd = open(SYSFS_MIGRATION_FILE, O_WRONLY); + if (fd == -1) { + say(ERROR, "Could not open \"%s\" to initiate migration, " + "%m\n", SYSFS_MIGRATION_FILE); + return -1; + } + + say(DEBUG, "Initiating migration via %s with %s\n", + SYSFS_MIGRATION_FILE, buf); + + rc = write(fd, buf, strlen(buf)); + if (rc < 0) { + say(DEBUG, "Write to migration file failed with rc: %d\n", rc); + rc = errno; + } else if (rc > 0) + rc = 0; + + close(fd); + say(DEBUG, "Kernel migration returned %d\n", rc); + } - say(DEBUG, "about to issue ibm,suspend-me(%llx)\n", stream_val); - rc = rtas_suspend_me(stream_val); - say(DEBUG, "ibm,suspend-me() returned %d\n", rc); return rc; } @@ -604,9 +639,9 @@ void post_mobility_update(int action) char *path; if (action == HIBERNATE) - path = "/sys/devices/system/power/hibernate"; + path = SYSFS_HIBERNATION_FILE; else - path = "/sys/kernel/mobility/migrate"; + path = SYSFS_MIGRATION_FILE; /* kernel will return 0 or sysfs attribute will be unreadable if drmgr needs to perform a device tree update */ -- 1.7.12.2 |
From: Dinar V. <k0...@op...> - 2015-02-26 10:18:44
|
On Thu, Jan 8, 2015 at 6:39 AM, Vasant Hegde <heg...@li...> wrote: > On 12/18/2014 03:23 AM, Nathan Fontenot wrote: >> On 12/14/2014 11:39 PM, Vasant Hegde wrote: >>> On 12/05/2014 04:11 PM, Henish Patel wrote: >>>> snap is not supported on the RHEL 7 onwards, because we have integrated snap >>>> functionality in sosreport. So this patch displays a suitable message on >>>> usage of snap tool. RHEL 7+ users can use sosreport to collect log data. >>>> >>> >>> Nathan, >>> >>> >>>> Signed-off-by: Henish Patel <hp...@li...> >>> >>> As you are aware we are trying to standardize data collection tool rather than >>> having separate tool for Power.. We have made necessary changes in distro >>> provided tools (sosreport for RH) to collect required data.. Also any future >>> changes goes to distro provided tools only.. >>> >> >> Not a problem. >> >> Do you know if there is any work to do this same thing for the other distro's? > > Yes .. We are planning to deprecate for SLES12 onwards as well.. We have pushed > all required changes to supportconfig command.. Let me confirm we have everything > in supportconfig.. Then will send out another patch. Do you have pull request link handy? > > > >> >> It appears we are on a path to deprecate this command, I'm just trying to figure >> out what the timeline for that looks like. > > All n-1 distro releases (like RHEL 6.x , SLES11.x) contains snap command. And we > have not > enabled distro provided tools in those releases to collect Power specific > information.. > > So should we carry this command for sometime in upstream or deprecate right way? > > > Note that RH is removed this command from RHEL7.1 onwards.. likewise recently > its removed > from Fedora as well. > > > > > -Vasant > >> >> -Nathan >> >>> Hence this patch adds necessary message to snap... >>> >>> >>> Reviewed-by: Vasant Hegde <heg...@li...> >>> >>> >>> -Vasant >>> >>>> --- >>>> scripts/snap | 14 +++++++++++++- >>>> 1 file changed, 13 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/scripts/snap b/scripts/snap >>>> index 3e547e6..1bede61 100755 >>>> --- a/scripts/snap >>>> +++ b/scripts/snap >>>> @@ -34,7 +34,19 @@ my $outfile = "snap.tar.gz"; # in the working dir. >>>> my $cmddir = "snap_commands"; # cmd output dir. >>>> my $cmdoutdir = "$outdir/$cmddir"; # in outdir dir. >>>> my $rsxx_exists = 0; # Does an IBM Flash Adapter exist? >>>> -my $distro_file = "/etc/issue" >>>> +my $distro_file = "/etc/issue"; >>>> +my $redhat_release_file = "/etc/redhat-release"; >>>> + >>>> +if (-e $redhat_release_file) { >>>> + open(RELEASE, "< $redhat_release_file") or die "open: $!\n"; >>>> + $_ = <RELEASE>; >>>> + my $redhat_version = (split / /, $_)[6]; >>>> + if ($redhat_version > 7.0) { >>>> + print "snap: is not supported on the RHEL 7 onwards..!\n"; >>>> + print "Please use sosreport to collect log data..!! \n"; >>>> + exit 1; >>>> + } >>>> +} >>>> >>>> our($opt_a, $opt_d, $opt_h, $opt_o, $opt_t, $opt_v); >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more >>>> Get technology previously reserved for billion-dollar corporations, FREE >>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Powerpc-utils-devel mailing list >>>> Pow...@li... >>>> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >>> with Interactivity, Sharing, Native Excel Exports, App Integration & more >>> Get technology previously reserved for billion-dollar corporations, FREE >>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Powerpc-utils-devel mailing list >>> Pow...@li... >>> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel >>> > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Henish P. <hp...@li...> - 2015-02-26 06:05:41
|
On 01/08/2015 01:56 AM, Nathan Fontenot wrote: > On 12/14/2014 11:39 PM, Vasant Hegde wrote: >> On 12/05/2014 04:11 PM, Henish Patel wrote: >>> snap is not supported on the RHEL 7 onwards, because we have integrated snap >>> functionality in sosreport. So this patch displays a suitable message on >>> usage of snap tool. RHEL 7+ users can use sosreport to collect log data. >>> >> Nathan, >> >> >>> Signed-off-by: Henish Patel <hp...@li...> >> As you are aware we are trying to standardize data collection tool rather than >> having separate tool for Power.. We have made necessary changes in distro >> provided tools (sosreport for RH) to collect required data.. Also any future >> changes goes to distro provided tools only.. >> >> Hence this patch adds necessary message to snap... >> >> >> Reviewed-by: Vasant Hegde <heg...@li...> >> >> >> -Vasant >> >>> --- >>> scripts/snap | 14 +++++++++++++- >>> 1 file changed, 13 insertions(+), 1 deletion(-) >>> >>> diff --git a/scripts/snap b/scripts/snap >>> index 3e547e6..1bede61 100755 >>> --- a/scripts/snap >>> +++ b/scripts/snap >>> @@ -34,7 +34,19 @@ my $outfile = "snap.tar.gz"; # in the working dir. >>> my $cmddir = "snap_commands"; # cmd output dir. >>> my $cmdoutdir = "$outdir/$cmddir"; # in outdir dir. >>> my $rsxx_exists = 0; # Does an IBM Flash Adapter exist? >>> -my $distro_file = "/etc/issue" >>> +my $distro_file = "/etc/issue"; >>> +my $redhat_release_file = "/etc/redhat-release"; >>> + >>> +if (-e $redhat_release_file) { >>> + open(RELEASE, "< $redhat_release_file") or die "open: $!\n"; >>> + $_ = <RELEASE>; >>> + my $redhat_version = (split / /, $_)[6]; >>> + if ($redhat_version > 7.0) { Nathan, I made required changes and sent second version of patch upstream. Thanks, Henish > Did you mean to disable snap for RHEL 7.0? If so this doesn't work, should > be; > if ($redhat_version >= 7.0) > >>> + print "snap: is not supported on the RHEL 7 onwards..!\n"; > Also, I think the colon in this message is not needed, just say "snap is not ...". > > -Nathan > >>> + print "Please use sosreport to collect log data..!! \n"; >>> + exit 1; >>> + } >>> +} >>> >>> our($opt_a, $opt_d, $opt_h, $opt_o, $opt_t, $opt_v); >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >>> with Interactivity, Sharing, Native Excel Exports, App Integration & more >>> Get technology previously reserved for billion-dollar corporations, FREE >>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Powerpc-utils-devel mailing list >>> Pow...@li... >>> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel >>> >> >> ------------------------------------------------------------------------------ >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Powerpc-utils-devel mailing list >> Pow...@li... >> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel >> |
From: Henish P. <hp...@li...> - 2015-02-25 14:52:45
|
snap is not supported on the RHEL 7 onwards, because we have integrated snap functionality in sosreport. So this patch displays a suitable message. RHEL 7+ users can use sosreport to collect log data. Signed-off-by: Henish Patel <hp...@li...> --- scripts/snap | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/snap b/scripts/snap index a3eb8c7..dc8abe1 100755 --- a/scripts/snap +++ b/scripts/snap @@ -34,7 +34,19 @@ my $outfile = "snap.tar.gz"; # in the working dir. my $cmddir = "snap_commands"; # cmd output dir. my $cmdoutdir = "$outdir/$cmddir"; # in outdir dir. my $rsxx_exists = 0; # Does an IBM Flash Adapter exist? -my $distro_file = "/etc/issue" +my $distro_file = "/etc/issue"; +my $redhat_release_file = "/etc/redhat-release"; + +if (-e $redhat_release_file) { + open(RELEASE, "< $redhat_release_file") or die "open: $!\n"; + $_ = <RELEASE>; + my $redhat_version = (split / /, $_)[6]; + if ($redhat_version >= 7.0) { + print "snap is not supported on the RHEL 7 onwards..!\n"; + print "Please use sosreport to collect log data..!! \n"; + exit 1; + } +} our($opt_a, $opt_d, $opt_h, $opt_o, $opt_t, $opt_v); |
From: Nathan F. <nf...@li...> - 2015-02-13 15:43:58
|
Hi all, Some of you have pointed out that the git repo for powerpc-utils was messed up in that the authors for the patches were incorrect. This is my fault, I tried to use stacked git to manage the git repo which put the wrong author in for each commit. I have just pushed an updated repo to sourceforge with all of the commit authors updated. Of course this sort of history re-writing makes a mess of the git repo so you may need to do a fresh pull or a new clone to pick up the changes. Sorry for the confusion, -Nathan |
From: Nathan F. <nf...@li...> - 2015-02-13 15:40:37
|
This has been pushed to the -next branch. -Nathan On 01/08/2015 12:27 PM, Paulo Flabiano Smorigo wrote: > This patch add a --with-systemd attribute to install a systemd unit > to turn smt on or off (permanently or not). > > After it's installed you can use systemd commands like: status, start, > stop, enable and disable to control it. > --- > .gitignore | 1 + > Makefile.am | 11 +++++++++++ > configure.ac | 18 +++++++++++++++++- > systemd/smt_off.service.in | 12 ++++++++++++ > 4 files changed, 41 insertions(+), 1 deletion(-) > create mode 100644 systemd/smt_off.service.in > > diff --git a/.gitignore b/.gitignore > index c0348c7..15d072b 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -47,6 +47,7 @@ > /src/Makefile.in > /src/drmgr/Makefile > /src/drmgr/Makefile.in > +/systemd/smt_off.service > > # > # git files that we don't want to ignore even it they are dot-files > diff --git a/Makefile.am b/Makefile.am > index c302a54..3735a11 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -49,6 +49,10 @@ EXTRA_DIST += COPYRIGHT Changelog powerpc-utils.spec.in doc/activate_firmware.do > doc/nvram.doxycfg doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg \ > doc/set_poweron_time.doxycfg doc/uesensor.doxycfg > > +if WITH_SYSTEMD > +EXTRA_DIST += systemd/smt_off.service.in > +endif > + > sbin_PROGRAMS += src/nvram src/lsprop src/lparstat src/ppc64_cpu > > pseries_platform_SOURCES = src/common/pseries_platform.c src/common/pseries_platform.h > @@ -145,3 +149,10 @@ src_drmgr_lsslot_SOURCES = \ > $(pseries_platform_SOURCES) > > src_drmgr_lsslot_LDADD = -lrtas > + > +if WITH_SYSTEMD > +install-data-hook: systemd/smt_off.service > + $(MKDIR_P) @prefix@${systemd_unit_dir} > + $(INSTALL_SCRIPT) $< @prefix@${systemd_unit_dir}/ > + sed -i -e 's,$${exec_prefix},@sbindir@,g' @prefix@${systemd_unit_dir}/smt_off.service > +endif > diff --git a/configure.ac b/configure.ac > index f7fcd55..7fa5b01 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -58,6 +58,22 @@ AS_IF([test "x$with_librtas" != "xno"], > > AM_CONDITIONAL([WITH_LIBRTAS], [test "x$with_librtas" = "xyes"]) > > +# check for systemd > +systemd_unit_dir=/usr/lib/systemd/system > +AC_ARG_WITH([systemd], > + [AC_HELP_STRING([--with-systemd@<:@=DIR@:>@], > + [install systemd unit files (not default and unit dir is /usr/lib/systemd/system)])], > + [if test "$withval" = "no"; then > + with_systemd=0 > + else > + with_systemd=1 > + test $withval != "yes" && systemd_unit_dir=$withval > + fi], > + with_systemd=0 > + ) > +AM_CONDITIONAL(WITH_SYSTEMD, [test "$with_systemd" = 1]) > +AC_SUBST(systemd_unit_dir) > + > AC_DEFUN([LOCAL_CHECK_FLAGS],[ > AC_REQUIRE([AX_CHECK_LINK_FLAG]) > AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) > @@ -72,5 +88,5 @@ AC_DEFUN([LOCAL_CHECK_FLAGS],[ > ]) > LOCAL_CHECK_FLAGS > > -AC_CONFIG_FILES([Makefile powerpc-utils.spec]) > +AC_CONFIG_FILES([Makefile powerpc-utils.spec systemd/smt_off.service]) > AC_OUTPUT > diff --git a/systemd/smt_off.service.in b/systemd/smt_off.service.in > new file mode 100644 > index 0000000..ed95945 > --- /dev/null > +++ b/systemd/smt_off.service.in > @@ -0,0 +1,12 @@ > +[Unit] > +Description=ppc64 set SMT off > +Before=libvirt-bin.service > + > +[Service] > +Type=oneshot > +RemainAfterExit=true > +ExecStart=@sbindir@/ppc64_cpu --smt=off > +ExecStop=@sbindir@/ppc64_cpu --smt=on > + > +[Install] > +WantedBy=multi-user.target > |
From: Vasant H. <heg...@li...> - 2015-01-20 07:00:12
|
On 01/14/2015 08:55 PM, Nathan Fontenot wrote: > Initial man page for the ppc64_cpu command. > > > Signed-off-by: Nathan Fontenot <nf...@li...> Nice one.. Reviewed-by: Vasant Hegde <heg...@li...> -Vasant > --- > Makefile.am | 3 + > man/ppc64_cpu.8 | 108 +++++++++++++++++++++++++++++++++++++++++++++++++ > powerpc-utils.spec.in | 1 > 3 files changed, 111 insertions(+), 1 deletion(-) > create mode 100644 man/ppc64_cpu.8 > > diff --git a/Makefile.am b/Makefile.am > index c302a54..d6a7e60 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -40,7 +40,8 @@ man_MANS = \ > man/sys_ident.8 \ > man/lparcfg.5 \ > man/lparstat.8 \ > - man/lsslot.8 > + man/lsslot.8 \ > + man/ppc64_cpu.8 > > EXTRA_DIST += $(bin_SCRIPTS) $(sbin_SCRIPTS) $(man_MANS) > > diff --git a/man/ppc64_cpu.8 b/man/ppc64_cpu.8 > new file mode 100644 > index 0000000..f6f8873 > --- /dev/null > +++ b/man/ppc64_cpu.8 > @@ -0,0 +1,108 @@ > +.\" > +.\" Copyright (C) 2015 International Business Machines > +.\" > +.TH PPC64_CPU 8 "January 2015" Linux "Linux on Power Service Tools" > +.SH NAME > +ppc64_cpu \- Display cpu characteristics of PowerPC systems > +.SH SYNOPSIS > +.B /usr/sbin/ppc64_cpu > +[ command ] [ options ] > +.SH DESCRIPTION > +The > +.I ppc64_cpu > +command is used to display and set cpu characteristics on PowerPC > +platforms. > + > +.SH OPTIONS > +.TP > +\fB\-\-smt\fR > +Display the current smt setting for the system. The output will state > +whether smt is off indicating there is only one thread per core online, smt > +is on indicating that all threads of every core is online, the smt is in > +a mixed state indicating that the number of threads online varies per core, or > +'SMT=X' indicating a specific smt state. > + > +.TP > +\fB\-\-smt\fR={\fIon\fR|\fIoff\fR} > +Set the current smt state for the system to either \fIon\fR, which will online > +every thread in every core on the system, or \fIoff\fR which will leave each > +core on the system with only one thread online. > + > +.TP > +\fB\-\-smt\fR=\fIvalue\fR > +Set the smt state for each core to the specified \fIvalue\fR. > + > +.TP > +\fB\-\-cores\-present\fR > +Display the number of cores present. > + > +.TP > +\fB\-\-cores\-on\fR > +Display the number of cores online. > + > +.TP > +\fB\-\-cores\-on\fR=\fIvalue\fR > +Put exactly \fIvalue\fR number of cores online. Note that this will either > +online or offline cores to achieve the desired result. > + > +.TP > +\fB\-\-dscr\fR > +Display the current Data Stream Control Register (DSCR) setting for the system. > + > +.TP > +\fB\-\-dscr\fR=\fIvalue\fR > +Set the DSCR setting for the system to \fIvalue\fr. > + > +.TP > +\fB\-\-dscr\fR [\fIpid\fR] > +Display the DSCR setting for process \fIpid\fR. > + > +.TP > +\fB\-\-dscr\fR=\fIvalue\fR [\fIpid\fR] > +Set the DSCR to the specified \fIvalue\fR for process \fIpid\fR. > + > +.TP > +\fB\-\-smt\-snooze\-delay\fR > +Display the current smt\-snooze\-delay setting. > + > +.TP > +\fB\-\-smt\-snooze\-delay\fR=\fIvalue\fR > +Set the smt\-snooze\-delay to the specified \fIvalue\fR. > + > +.TP > +\fB\-\-run-mode\fR > +Display the current diagnostics run mode. > + > +.TP > +\fB\-\-run\-mode\fR=\fIvalue\fR > +Set the current diagnostics run mode to \fIvalue\fR. > + > +.TP > +\fB\-\-frequency\fR [\-t \fItime\fR] > +Determine the cpu frequency. The default sampling period is one second unless > +a time is specified with the \fB\-t \fItime\fR option. > + > +.TP > +\fB\-\-subcores\-per\-core\fR > +Display the number of subcores per core. > + > +.TP > +\fB\-\-subcores\-per\-core\fR=\fIvalue\fR > +Set the number of subcores per core to \fIvalue\fR. > + > +.TP > +\fB\-\-threads\-per\-core\fR > +Display the number of threads per core. > + > +.TP > +\fB\-\-info\fR > +Display system state information. The output will print a line for each core > +and possible sub\-core along with the thread numbers for each thread in the > +core with an asterick next to it if the thread is online. > + > +.TP > +\fB\-\-version\fR > +Print the version number. > + > +.SH AUTHOR > +Written by Anton Blanchard and Nathan Fontenot > diff --git a/powerpc-utils.spec.in b/powerpc-utils.spec.in > index c780743..10baf22 100644 > --- a/powerpc-utils.spec.in > +++ b/powerpc-utils.spec.in > @@ -84,6 +84,7 @@ Utilities for maintaining and servicing PowerPC systems. > /usr/share/man/man5/lparcfg.5.gz > /usr/share/man/man8/lparstat.8.gz > /usr/share/man/man8/lsslot.8.gz > +/usr/share/man/man8/ppc64_cpu.8.gz > /usr/share/man/man1/amsstat.1.gz > > %post > > > ------------------------------------------------------------------------------ > New Year. New Location. New Benefits. New Data Center in Ashburn, VA. > GigeNET is offering a free month of service with a new server in Ashburn. > Choose from 2 high performing configs, both with 100TB of bandwidth. > Higher redundancy.Lower latency.Increased capacity.Completely compliant. > http://p.sf.net/sfu/gigenet > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > |