All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] Simplify grep actions in power_management.
@ 2015-11-09  8:05 Yuan Sun
  2015-11-09  8:05 ` [LTP] [PATCH 2/2] Simplify grep actions in cpuset_syscall_test Yuan Sun
  2015-11-09 12:10 ` [LTP] [PATCH 1/2] Simplify grep actions in power_management Jan Stancek
  0 siblings, 2 replies; 3+ messages in thread
From: Yuan Sun @ 2015-11-09  8:05 UTC (permalink / raw)
  To: ltp

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
---
 testcases/kernel/power_management/pm_include.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/power_management/pm_include.sh b/testcases/kernel/power_management/pm_include.sh
index 366c914..d06286b 100755
--- a/testcases/kernel/power_management/pm_include.sh
+++ b/testcases/kernel/power_management/pm_include.sh
@@ -87,8 +87,8 @@ get_supporting_govr() {
 }
 
 is_hyper_threaded() {
-	siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'`
-	cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'`
+	siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'`
+	cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq | cut -f2 -d':'`
 	[ $siblings -gt $cpu_cores ]; echo $?
 }
 
@@ -131,8 +131,8 @@ is_multi_socket() {
 }
 
 is_multi_core() {
-	siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'`
-	cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'`
+	siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'`
+	cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq | cut -f2 -d':'`
 	if [ $siblings -eq $cpu_cores ]; then
 		[ $cpu_cores -gt 1 ]; echo $?
 	else
@@ -142,8 +142,8 @@ is_multi_core() {
 }
 
 is_dual_core() {
-	siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'`
-        cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq \
+	siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'`
+	cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq \
 			| cut -f2 -d':'`
         if [ $siblings -eq $cpu_cores ]; then
                 [ $cpu_cores -eq 2 ]; echo $?
-- 
1.9.1


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

* [LTP] [PATCH 2/2] Simplify grep actions in cpuset_syscall_test.
  2015-11-09  8:05 [LTP] [PATCH 1/2] Simplify grep actions in power_management Yuan Sun
@ 2015-11-09  8:05 ` Yuan Sun
  2015-11-09 12:10 ` [LTP] [PATCH 1/2] Simplify grep actions in power_management Jan Stancek
  1 sibling, 0 replies; 3+ messages in thread
From: Yuan Sun @ 2015-11-09  8:05 UTC (permalink / raw)
  To: ltp

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
---
 .../cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
index 771b642..94b8824 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
@@ -188,7 +188,7 @@ test7()
 	do_syscall_test 0 0 --mbind=1 0 || return $?
 	memory_addr="$(cat $TEST_OUTPUT)"
 	memory_addr=${memory_addr##*0x}
-	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
+	allowed_list=$(grep "$memory_addr" $TEST_PROCNUMA | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 	test "$allowed_list" = "0" || return 1
@@ -204,7 +204,7 @@ test8()
 	do_syscall_test 0 0-1 --mbind=1 0 || return $?
 	memory_addr="$(cat $TEST_OUTPUT)"
 	memory_addr=${memory_addr##*0x}
-	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
+	allowed_list=$(grep "$memory_addr" $TEST_PROCNUMA | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 	test "$allowed_list" = "0"
@@ -220,7 +220,7 @@ test9()
 	do_syscall_test 0 0-1 --mbind=6 0 || return $?
 	memory_addr="$(cat $TEST_OUTPUT)"
 	memory_addr=${memory_addr##*0x}
-	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
+	allowed_list=$(grep "$memory_addr" $TEST_PROCNUMA | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 	test "$allowed_list" = "1"
@@ -236,11 +236,11 @@ test10()
 	do_syscall_test 0 0 --mbind=6 1 || return $?
 	memory_addr="$(cat $TEST_OUTPUT)"
 	memory_addr=${memory_addr##*0x}
-	allowed_list=$(cat $TEST_PROCNUMA | grep "$memory_addr" | \
+	allowed_list=$(grep "$memory_addr" $TEST_PROCNUMA | \
 			awk '{print $2}')
 	allowed_list="$(echo $allowed_list | sed -e s/bind://)"
 
-	task_policy=$(cat $TEST_PROCNUMA | grep -e "  *stack  *anon" | \
+	task_policy=$(grep -e "  *stack  *anon" $TEST_PROCNUMA | \
 			awk '{print $2}')
 
 	test "$allowed_list" = "$task_policy"
-- 
1.9.1


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

* [LTP] [PATCH 1/2] Simplify grep actions in power_management.
  2015-11-09  8:05 [LTP] [PATCH 1/2] Simplify grep actions in power_management Yuan Sun
  2015-11-09  8:05 ` [LTP] [PATCH 2/2] Simplify grep actions in cpuset_syscall_test Yuan Sun
@ 2015-11-09 12:10 ` Jan Stancek
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2015-11-09 12:10 UTC (permalink / raw)
  To: ltp





----- Original Message -----
> From: "Yuan Sun" <sunyuan3@huawei.com>
> To: chrubis@suse.cz, jstancek@redhat.com
> Cc: ltp@lists.linux.it
> Sent: Monday, 9 November, 2015 9:05:33 AM
> Subject: [PATCH 1/2] Simplify grep actions in power_management.
> 
> Signed-off-by: Yuan Sun <sunyuan3@huawei.com>

Both pushed.

Regards,
Jan

> ---
>  testcases/kernel/power_management/pm_include.sh | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/testcases/kernel/power_management/pm_include.sh
> b/testcases/kernel/power_management/pm_include.sh
> index 366c914..d06286b 100755
> --- a/testcases/kernel/power_management/pm_include.sh
> +++ b/testcases/kernel/power_management/pm_include.sh
> @@ -87,8 +87,8 @@ get_supporting_govr() {
>  }
>  
>  is_hyper_threaded() {
> -	siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'`
> -	cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'`
> +	siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'`
> +	cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq | cut -f2 -d':'`
>  	[ $siblings -gt $cpu_cores ]; echo $?
>  }
>  
> @@ -131,8 +131,8 @@ is_multi_socket() {
>  }
>  
>  is_multi_core() {
> -	siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'`
> -	cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | cut -f2 -d':'`
> +	siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'`
> +	cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq | cut -f2 -d':'`
>  	if [ $siblings -eq $cpu_cores ]; then
>  		[ $cpu_cores -gt 1 ]; echo $?
>  	else
> @@ -142,8 +142,8 @@ is_multi_core() {
>  }
>  
>  is_dual_core() {
> -	siblings=`cat /proc/cpuinfo | grep siblings | uniq | cut -f2 -d':'`
> -        cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq \
> +	siblings=`grep siblings /proc/cpuinfo | uniq | cut -f2 -d':'`
> +	cpu_cores=`grep "cpu cores" /proc/cpuinfo | uniq \
>  			| cut -f2 -d':'`
>          if [ $siblings -eq $cpu_cores ]; then
>                  [ $cpu_cores -eq 2 ]; echo $?
> --
> 1.9.1
> 
> 

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

end of thread, other threads:[~2015-11-09 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09  8:05 [LTP] [PATCH 1/2] Simplify grep actions in power_management Yuan Sun
2015-11-09  8:05 ` [LTP] [PATCH 2/2] Simplify grep actions in cpuset_syscall_test Yuan Sun
2015-11-09 12:10 ` [LTP] [PATCH 1/2] Simplify grep actions in power_management Jan Stancek

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.