Linux Test Project
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: ltp@lists.linux.it
Subject: [LTP] MD-RAID: Use seq_putc() in three status functions?
Date: Fri, 28 Oct 2016 22:04:33 +0200	[thread overview]
Message-ID: <69acd529-fc75-bd74-17ae-bedd8796e706@users.sourceforge.net> (raw)
In-Reply-To: <e264883f-d1b9-4bf3-aa9f-45fce5dab18e@users.sourceforge.net>

>>> So back to the original task for you: Show me in the generated output where the benefits are.

I can offer another bit of information for this software development discussion.

The following build settings were active in my "Makefile" for this Linux test case.

…
HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O0 -fomit-frame-pointer -std=gnu89
…


The afffected source files can be compiled for the processor architecture "x86_64"
by a tool like "GCC 6.2.1+r239849-1.5" from the software distribution
"openSUSE Tumbleweed" with the following command example.

my_original=${my_build_dir}unchanged/test/ \
&& my_fixing=${my_build_dir}patched/test/ \
&& mkdir -p ${my_original} ${my_fixing} \
&& my_cc=/usr/bin/gcc-6 \
&& my_module=drivers/md/raid1.s \
&& git checkout next-20161014 \
&& make -j6 O="${my_original}" CC="${my_cc}" HOSTCC="${my_cc}" allmodconfig "${my_module}" \
&& git checkout next_usage_of_seq_putc_in_md_raid_1 \
&& make -j6 O="${my_fixing}" CC="${my_cc}" HOSTCC="${my_cc}" allmodconfig "${my_module}" \
&& diff -u "${my_original}${my_module}" "${my_fixing}${my_module}" > "${my_build_dir}assembler_code_comparison_$(date -I)_3.diff"


The generated file got the size "25.4 KiB" this time. I guess that only
the following two diff hunks are interesting then to show desired effects
for the suggested software refactoring around data output of a single character
(instead of a similar string).


…
@@ -4402,10 +4402,6 @@
 .LC19:
 	.string	"%s"
 	.zero	61
-	.align 32
-.LC20:
-	.string	"]"
-	.zero	62
 	.text
 	.p2align 4,,15
 	.type	raid1_status, @function
@@ -4564,8 +4560,8 @@
 	movq	$rcu_lock_map, %rdi	#,
 	call	lock_release	#
 	movq	%r14, %rdi	# seq,
-	movq	$.LC20, %rsi	#,
-	call	seq_printf	#
+	movl	$93, %esi	#,
+	call	seq_putc	#
 	addq	$16, %rsp	#,
 	popq	%rbx	#
 	popq	%r12	#
…


* Is this kind of assembler code comparison useful to clarify relevant
  differences further?

* Are any software development concerns left over for such a transformation?

Regards,
Markus


  reply	other threads:[~2016-10-28 20:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <566ABCD9.1060404@users.sourceforge.net>
     [not found] ` <786843ef-4b6f-eb04-7326-2f6f5b408826@users.sourceforge.net>
     [not found]   ` <92c52f1d-d151-cea6-e9ac-31378e6862d0@users.sourceforge.net>
     [not found]     ` <1475771699.1914.10.camel@perches.com>
     [not found]       ` <77fb6fdc-7480-8607-0af1-42f73c125b9d@users.sourceforge.net>
     [not found]         ` <688764a4-072d-2faf-37ba-a222b190a5d9@suse.de>
     [not found]           ` <59d71170-c48d-a084-c748-b6ab74a2bee4@users.sourceforge.net>
     [not found]             ` <1e151094-e228-5307-ae2f-b376b31f5628@suse.de>
     [not found]               ` <83e720c6-9037-a3c1-6e83-27505805f37f@users.sourceforge.net>
     [not found]                 ` <2cc42b2f-1f1a-e95c-91fa-54e1dd3b6d49@suse.de>
2016-10-17  9:00                   ` [LTP] MD-RAID: Use seq_putc() in three status functions? SF Markus Elfring
2016-10-17  9:50                     ` Hannes Reinecke
2016-10-17 11:10                       ` SF Markus Elfring
2016-10-17 11:32                         ` Bernd Petrovitsch
2016-10-17 11:43                           ` SF Markus Elfring
2016-10-17 14:01                             ` Hannes Reinecke
2016-10-17 14:30                               ` SF Markus Elfring
2016-10-17 15:33                                 ` Hannes Reinecke
2016-10-17 16:08                                   ` SF Markus Elfring
2016-10-17 17:18                                     ` Hannes Reinecke
2016-10-18 18:20                                       ` SF Markus Elfring
2016-10-20 12:24                                         ` SF Markus Elfring
2016-10-28 20:04                                           ` SF Markus Elfring [this message]
2016-10-17 14:00                         ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69acd529-fc75-bd74-17ae-bedd8796e706@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox