All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] cpu_hotplug/cpuhotplug03.sh: Accurately select command name by -C option
@ 2018-11-16 11:10 Xiao Yang
  2018-12-05 21:13 ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2018-11-16 11:10 UTC (permalink / raw)
  To: ltp

Since procps v3.3.15, running cpuhotplug03.sh got the following error:
----------------------------------------------------------------------
cpuhotplug03 1 TINFO: Onlining CPU 1
cpuhotplug03 1 TBROK: No cpuhotplug_do_spin_loop processes found on any processor
----------------------------------------------------------------------

On procps v3.3.15, ps command name selection is extended to 64 characters
so procps cannot trucate normal command name to 15 characters by default.
In addition, normal command name is truncated to 16 characters and stored
in /proc/<pid>/stat and /proc/<pid>/status in kernel.(except workqueue worker
because it has been extended to 64 by kernel commit 6b59808)

References:
procps commit: bb272580a6f3c192c61e307f9e341514d892d06e
procps commit: 14005a371e5c14289e96a4927ffd1a827d3c9d85
procps commit: 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8
kernel commit: 6b59808bfe482642287ddf3fe9d4cccb10756652

Note:
I think the lastest ps(1) manpage for command name length is confused
because kernel only extend workqueue worker name to 64 characters by
commit 6b59808 and still truncate normal command name to 16 characters.
e.g:
---------------------------------------------------------------------
cd /root/ltp/testcases/kernel/hotplug/cpu_hotplug/tools
PATH=$PATH:$PWD cpuhotplug_do_spin_loop &
[1] 8732
cat /proc/8732/stat
8732 (cpuhotplug_do_s) ...
cat /proc/8732/status | grep Name
Name:   cpuhotplug_do_s
---------------------------------------------------------------------

I will try to update ps(1) manpage for command name length.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
index 14ccf85..a8c76a0 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
@@ -119,12 +119,20 @@ until [ $LOOP_COUNT -gt $HOTPLUG03_LOOPS ]; do
 	sleep 1
 
 	# Verify at least one process has migrated to the new CPU
-	ps -o psr -o command --no-headers -C cpuhotplug_do_spin_loop
+	# Since procps v3.3.15, we need to accurately select command name
+	# by -C option, because procps cannot trucate normal command name
+	# to 15 characters by default).
+	# References:
+	# procps commit: bb272580a6f3c192c61e307f9e341514d892d06e
+	# procps commit: 14005a371e5c14289e96a4927ffd1a827d3c9d85
+	# procps commit: 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8
+	# kernel commit: 6b59808bfe482642287ddf3fe9d4cccb10756652
+	ps -o psr -o command --no-headers -C cpuhotplug_do_s
 	if [ $? -ne 0 ]; then
 		tst_brkm TBROK "No cpuhotplug_do_spin_loop processes \
 			found on any processor"
 	fi
-	NUM=`ps -o psr -o command --no-headers -C cpuhotplug_do_spin_loop \
+	NUM=`ps -o psr -o command --no-headers -C cpuhotplug_do_s \
 		| sed -e "s/^ *//" | cut -d' ' -f 1 | grep "^${CPU_TO_TEST}$" \
 		| wc -l`
 	if [ $NUM -lt 1 ]; then
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] cpu_hotplug/cpuhotplug03.sh: Accurately select command name by -C option
  2018-11-16 11:10 [LTP] [PATCH] cpu_hotplug/cpuhotplug03.sh: Accurately select command name by -C option Xiao Yang
@ 2018-12-05 21:13 ` Petr Vorel
  2018-12-24 11:12   ` Xiao Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2018-12-05 21:13 UTC (permalink / raw)
  To: ltp

Hi Xiao,

> Since procps v3.3.15, running cpuhotplug03.sh got the following error:
> ----------------------------------------------------------------------
> cpuhotplug03 1 TINFO: Onlining CPU 1
> cpuhotplug03 1 TBROK: No cpuhotplug_do_spin_loop processes found on any processor
> ----------------------------------------------------------------------

> On procps v3.3.15, ps command name selection is extended to 64 characters
> so procps cannot trucate normal command name to 15 characters by default.
> In addition, normal command name is truncated to 16 characters and stored
> in /proc/<pid>/stat and /proc/<pid>/status in kernel.(except workqueue worker
> because it has been extended to 64 by kernel commit 6b59808)

> References:
> procps commit: bb272580a6f3c192c61e307f9e341514d892d06e
> procps commit: 14005a371e5c14289e96a4927ffd1a827d3c9d85
> procps commit: 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8
> kernel commit: 6b59808bfe482642287ddf3fe9d4cccb10756652

> Note:
> I think the lastest ps(1) manpage for command name length is confused
> because kernel only extend workqueue worker name to 64 characters by
> commit 6b59808 and still truncate normal command name to 16 characters.
> e.g:
> ---------------------------------------------------------------------
> cd /root/ltp/testcases/kernel/hotplug/cpu_hotplug/tools
> PATH=$PATH:$PWD cpuhotplug_do_spin_loop &
> [1] 8732
> cat /proc/8732/stat
> 8732 (cpuhotplug_do_s) ...
> cat /proc/8732/status | grep Name
> Name:   cpuhotplug_do_s
> ---------------------------------------------------------------------
Agree.

> I will try to update ps(1) manpage for command name length.
Good :).

> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
> ---
>  .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh    | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] cpu_hotplug/cpuhotplug03.sh: Accurately select command name by -C option
  2018-12-05 21:13 ` Petr Vorel
@ 2018-12-24 11:12   ` Xiao Yang
  2019-01-03 21:03     ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2018-12-24 11:12 UTC (permalink / raw)
  To: ltp

Hi Petr,

Could you push this patch if nobody has objections. :-)

Best Regards,
Xiao Yang
On 2018/12/06 5:13, Petr Vorel wrote:
> Hi Xiao,
>
>> Since procps v3.3.15, running cpuhotplug03.sh got the following error:
>> ----------------------------------------------------------------------
>> cpuhotplug03 1 TINFO: Onlining CPU 1
>> cpuhotplug03 1 TBROK: No cpuhotplug_do_spin_loop processes found on any processor
>> ----------------------------------------------------------------------
>> On procps v3.3.15, ps command name selection is extended to 64 characters
>> so procps cannot trucate normal command name to 15 characters by default.
>> In addition, normal command name is truncated to 16 characters and stored
>> in /proc/<pid>/stat and /proc/<pid>/status in kernel.(except workqueue worker
>> because it has been extended to 64 by kernel commit 6b59808)
>> References:
>> procps commit: bb272580a6f3c192c61e307f9e341514d892d06e
>> procps commit: 14005a371e5c14289e96a4927ffd1a827d3c9d85
>> procps commit: 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8
>> kernel commit: 6b59808bfe482642287ddf3fe9d4cccb10756652
>> Note:
>> I think the lastest ps(1) manpage for command name length is confused
>> because kernel only extend workqueue worker name to 64 characters by
>> commit 6b59808 and still truncate normal command name to 16 characters.
>> e.g:
>> ---------------------------------------------------------------------
>> cd /root/ltp/testcases/kernel/hotplug/cpu_hotplug/tools
>> PATH=$PATH:$PWD cpuhotplug_do_spin_loop&
>> [1] 8732
>> cat /proc/8732/stat
>> 8732 (cpuhotplug_do_s) ...
>> cat /proc/8732/status | grep Name
>> Name:   cpuhotplug_do_s
>> ---------------------------------------------------------------------
> Agree.
>
>> I will try to update ps(1) manpage for command name length.
> Good :).
>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> Acked-by: Petr Vorel<pvorel@suse.cz>
>> ---
>>   .../kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh    | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>
> Kind regards,
> Petr
>
>
> .
>




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] cpu_hotplug/cpuhotplug03.sh: Accurately select command name by -C option
  2018-12-24 11:12   ` Xiao Yang
@ 2019-01-03 21:03     ` Petr Vorel
  2019-01-04  2:38       ` Xiao Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2019-01-03 21:03 UTC (permalink / raw)
  To: ltp

Hi Xiao,

...
> > > References:
> > > procps commit: bb272580a6f3c192c61e307f9e341514d892d06e
> > > procps commit: 14005a371e5c14289e96a4927ffd1a827d3c9d85
> > > procps commit: 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8
> > > kernel commit: 6b59808bfe482642287ddf3fe9d4cccb10756652

Merged with minor changes: remove references from code and use standard
references (short has + commit message) in commit message.

Thanks for your patch!.

> > > Note:
> > > I think the lastest ps(1) manpage for command name length is confused
> > > because kernel only extend workqueue worker name to 64 characters by
> > > commit 6b59808 and still truncate normal command name to 16 characters.
> > > e.g:
> > > ---------------------------------------------------------------------
> > > cd /root/ltp/testcases/kernel/hotplug/cpu_hotplug/tools
> > > PATH=$PATH:$PWD cpuhotplug_do_spin_loop&
> > > [1] 8732
> > > cat /proc/8732/stat
> > > 8732 (cpuhotplug_do_s) ...
> > > cat /proc/8732/status | grep Name
> > > Name:   cpuhotplug_do_s
> > > ---------------------------------------------------------------------
> > Agree.

> > > I will try to update ps(1) manpage for command name length.
> > Good :).
Out of curiosity: have you reported it to procps upstream?


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH] cpu_hotplug/cpuhotplug03.sh: Accurately select command name by -C option
  2019-01-03 21:03     ` Petr Vorel
@ 2019-01-04  2:38       ` Xiao Yang
  0 siblings, 0 replies; 5+ messages in thread
From: Xiao Yang @ 2019-01-04  2:38 UTC (permalink / raw)
  To: ltp

On 2019/01/04 5:03, Petr Vorel wrote:
> Hi Xiao,
>
> ...
>>>> References:
>>>> procps commit: bb272580a6f3c192c61e307f9e341514d892d06e
>>>> procps commit: 14005a371e5c14289e96a4927ffd1a827d3c9d85
>>>> procps commit: 2cfdbbe897f0d4e41460c7c2b92acfc5804652c8
>>>> kernel commit: 6b59808bfe482642287ddf3fe9d4cccb10756652
> Merged with minor changes: remove references from code and use standard
> references (short has + commit message) in commit message.
>
> Thanks for your patch!.
Hi Petr,

Thanks for your push.
>>>> Note:
>>>> I think the lastest ps(1) manpage for command name length is confused
>>>> because kernel only extend workqueue worker name to 64 characters by
>>>> commit 6b59808 and still truncate normal command name to 16 characters.
>>>> e.g:
>>>> ---------------------------------------------------------------------
>>>> cd /root/ltp/testcases/kernel/hotplug/cpu_hotplug/tools
>>>> PATH=$PATH:$PWD cpuhotplug_do_spin_loop&
>>>> [1] 8732
>>>> cat /proc/8732/stat
>>>> 8732 (cpuhotplug_do_s) ...
>>>> cat /proc/8732/status | grep Name
>>>> Name:   cpuhotplug_do_s
>>>> ---------------------------------------------------------------------
>>> Agree.
>>>> I will try to update ps(1) manpage for command name length.
>>> Good :).
> Out of curiosity: have you reported it to procps upstream?
I have reported and sent a fix patch to procps mail list(i.e. 
procps@freelists.org), but it
seems that nobody reveiws and pushes it.   I am going to ping. :-)

Please see attachment for our fix patch.

Best Regards,
Xiao Yang
>
> Kind regards,
> Petr
>
>
>



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-docs-Correct-ps.1-for-command-name-length.patch
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190104/b5db03ce/attachment-0001.ksh>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-04  2:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-16 11:10 [LTP] [PATCH] cpu_hotplug/cpuhotplug03.sh: Accurately select command name by -C option Xiao Yang
2018-12-05 21:13 ` Petr Vorel
2018-12-24 11:12   ` Xiao Yang
2019-01-03 21:03     ` Petr Vorel
2019-01-04  2:38       ` Xiao Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.