From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: perfbook@vger.kernel.org
Subject: Re: [GIT PULL v5] Trial of labeling lines in code snippets
Date: Sun, 5 Aug 2018 16:40:40 -0700 [thread overview]
Message-ID: <20180805234039.GL24813@linux.vnet.ibm.com> (raw)
In-Reply-To: <c5ef5787-27dd-bbcd-5d48-81bee1b64d3b@gmail.com>
On Mon, Aug 06, 2018 at 08:26:03AM +0900, Akira Yokosawa wrote:
> On 2018/08/05 15:47:19 -0700, Paul E. McKenney wrote:
> > On Mon, Aug 06, 2018 at 06:58:20AM +0900, Akira Yokosawa wrote:
> >> On 2018/08/05 09:54:48 -0700, Paul E. McKenney wrote:
> >>> On Sun, Aug 05, 2018 at 09:35:08AM -0700, Paul E. McKenney wrote:
> >>>> On Sun, Aug 05, 2018 at 09:06:27AM +0900, Akira Yokosawa wrote:
> >>>>> Hi Paul,
> >>>>>
> >>>>> This is hopefully the final version of this trial branch.
> >>>>>
> >>>>> Changes since v4:
> >>>>>
> >>>>> o Instead of generating CodeSamples/snippets.mk and calling it from
> >>>>> main Makefile, generate CodeSamples/snippets.d which contains
> >>>>> only dependencies and include it in the Makefile.
> >>>>>
> >>>>> This change can fix the error you encountered in the previous version.
> >>>>> I'm just hoping...
> >>>>
> >>>> Hmmmm...
> >>>>
> >>>> $ make
> >>>> sh ./utilities/gen_snippet_d.sh
> >>>> CodeSamples/toolsoftrade/pcreate.c --> CodeSamples/toolsoftrade/pcreate@mythread.fcv
> >>>>
> >>>> But "make 2c" works. This might be because I don't have the
> >>>> PERFBOOK_DEFAULT environment variable set? Except that the Makefile code
> >>>> looks like this would have the default "make all" have the same effect as
> >>>> "make 2c". Color me confused.
> >>
> >> No. It was my fault. I failed to test the simple "make".
> >> To override my env variable setting of "PERFBOOK_DEFUALT=msnt 1csf",
> >> I tend to use one of "make msnt" or "make msnt 1csf" or "make 2c".
> >>
> >> I see the same behavior when I do simple "make" regardless
> >> of PERFBOOK_DEFAULT is set or unset.
> >
> > Been there, done that! ;-)
> >
> >>>> Anyway, yes, when I do "make 2c" it correctly reacts to moving labels
> >>>> around in CodeSamples/toolsoftrade/forkjoinvar.c, so that is good!
> >>>>
> >>>> Here is the output of "make -v", in case that matters:
> >>>>
> >>>> GNU Make 3.81
> >>>> Copyright (C) 2006 Free Software Foundation, Inc.
> >>>> This is free software; see the source for copying conditions.
> >>>> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> >>>> PARTICULAR PURPOSE.
> >>>>
> >>>> This program built for x86_64-pc-linux-gnu
> >>>
> >>> And the diff below restores the behavior I would expect for "make",
> >>> even when modifying tags in CodeSamples/toolsoftrade/forkjoinvar.c,
> >>> though of course it might well break something else. (And the diff
> >>> happens to include my test change to forkjoinvar.c.)
> >>>
> >>> Thoughts?
> >>>
> >>> Thanx, Paul
> >>>
> >>> ------------------------------------------------------------------------
> >>>
> >>> diff --git a/Makefile b/Makefile
> >>> index fe9f63f43e55..3e9e2c2ebf3c 100644
> >>> --- a/Makefile
> >>> +++ b/Makefile
> >>> @@ -85,13 +85,6 @@ endif
> >>> SOURCES_OF_SNIPPET := $(shell grep -r -l -F '\begin{snippet}' CodeSamples)
> >>> GEN_SNIPPET_D = utilities/gen_snippet_d.pl utilities/gen_snippet_d.sh
> >>>
> >>> -ifeq ($(MAKECMDGOALS),clean)
> >>> -else ifeq ($(MAKECMDGOALS),distclean)
> >>> -else ifeq ($(MAKECMDGOALS),neatfreak)
> >>> -else
> >>> --include CodeSamples/snippets.d
> >>> -endif
> >>> -
> >>> default = $(PERFBOOK_DEFAULT)
> >>>
> >>> ifeq ($(default),)
> >>> @@ -103,6 +96,13 @@ endif
> >>> .PHONY: all touchsvg clean distclean neatfreak 2c ls-unused $(ABBREVTARGETS) mslm perfbook-mslm.pdf mslmmsg help
> >>> all: $(targ)
> >>>
> >>> +ifeq ($(MAKECMDGOALS),clean)
> >>> +else ifeq ($(MAKECMDGOALS),distclean)
> >>> +else ifeq ($(MAKECMDGOALS),neatfreak)
> >>> +else
> >>> +-include CodeSamples/snippets.d
> >>> +endif
> >>> +
> >>> 2c: perfbook.pdf
> >>>
> >>> mslm: perfbook-mslm.pdf
> >>
> >> This change works for me too.
> >>
> >> Do you want me to add the change to the trial branch?
> >> I don't mind if you add the change yourself with my
> >>
> >> Acked-by: Akira Yokosawa <akiyks@gmail.com>
> >>
> >> Of course, the following diff should be omitted.
> >
> > I pushed out an akiyks.2018.08.05a branch with the commit (but without
> > the forkjoinvar.c change), and with your ack.
> >
> > When you say it is ready, I will bring my master branch out to that
> > commit. Or if you have another pull request for an updated version
> > of this series, I will replace it with that.
>
> I amended the commit log.
> Appended is the pull request. See below.
Looks good, thank you! I have pulled this and pushed it as my
master branch.
Thanx, Paul
> Thanks, Akira
>
> >
> > Either way, please let me know!
> >
> > Thanx, Paul
> >
> >> Thanks, Akira
> >>
> >>> diff --git a/CodeSamples/toolsoftrade/forkjoinvar.c b/CodeSamples/toolsoftrade/forkjoinvar.c
> >>> index 1580478fe2f9..642451d9e880 100644
> >>> --- a/CodeSamples/toolsoftrade/forkjoinvar.c
> >>> +++ b/CodeSamples/toolsoftrade/forkjoinvar.c
> >>> @@ -35,11 +35,11 @@ int main(int argc, char *argv[])
> >>> if (pid == 0) { /* child */
> >>> x = 1; //\lnlbl{setx}
> >>> printf("Child process set x=1\n"); //\lnlbl{print:c}
> >>> - exit(EXIT_SUCCESS); //\lnlbl{exit:s}
> >>> + exit(EXIT_SUCCESS);
> >>> }
> >>> if (pid < 0) { /* parent, upon error */
> >>> perror("fork");
> >>> - exit(EXIT_FAILURE);
> >>> + exit(EXIT_FAILURE); //\lnlbl{exit:s}
> >>> }
> >>>
> >>> /* parent */
> >>>
> >>
> >
>
> ---
> The following changes since commit 3b62f67a76e15f8d8f8190a4252362d4ac0cdf23:
>
> Regenerating the atomic counter graph on a more modern CPU (2018-07-23 13:47:51 -0700)
>
> are available in the git repository at:
>
> https://github.com/akiyks/perfbook.git trial-fancyvrb-20180805a
>
> for you to fetch changes up to 78141e64d4629b29643634fc1d334233f108f656:
>
> Makefile: Fix "make" behavior (2018-08-06 08:18:49 +0900)
>
> ----------------------------------------------------------------
> Akira Yokosawa (12):
> toolsoftrade: Add labels in code samples as comments
> Add script to extract code snippet from code sample
> toolsoftrade: Reference line in code snippets by label
> Update hyphen2endash
> Add *.fcv to .gitignore
> Automate sub makefile update
> Specify lmtt font for VerbatimM env
> toolsoftrade: Use \lnlbl in inline code snippet
> Add 'linelabel' and 'lineref' environment
> Catch failure in genaration of CodeSamples/snippets.mk
> Add dependencis to scripts for extracting code snippets
> Add dependencies of perfbook_flat.tex to CodeSamples/.../*.fcv files
>
> Paul E. McKenney (1):
> Makefile: Fix "make" behavior
>
> .gitignore | 2 +
> CodeSamples/api-pthreads/api-pthreads.h | 18 +--
> CodeSamples/toolsoftrade/forkjoinvar.c | 12 +-
> CodeSamples/toolsoftrade/pcreate.c | 7 +-
> Makefile | 25 +++-
> perfbook.tex | 21 ++++
> toolsoftrade/toolsoftrade.tex | 211 +++++++++++---------------------
> utilities/fcvextract.pl | 168 +++++++++++++++++++++++++
> utilities/gen_snippet_d.pl | 65 ++++++++++
> utilities/gen_snippet_d.sh | 8 ++
> utilities/hyphen2endash.sh | 3 +
> 11 files changed, 382 insertions(+), 158 deletions(-)
> create mode 100755 utilities/fcvextract.pl
> create mode 100755 utilities/gen_snippet_d.pl
> create mode 100644 utilities/gen_snippet_d.sh
>
>
prev parent reply other threads:[~2018-08-06 1:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-21 0:19 [NOT YET PULL] Trial of labeling lines in code snippets Akira Yokosawa
2018-07-21 16:51 ` Paul E. McKenney
2018-07-22 15:43 ` Akira Yokosawa
2018-07-22 22:49 ` Paul E. McKenney
2018-07-23 15:09 ` Akira Yokosawa
2018-07-23 15:12 ` Akira Yokosawa
2018-07-23 21:03 ` Paul E. McKenney
2018-07-30 16:04 ` [NOT YET PULL v2] " Akira Yokosawa
2018-07-31 15:10 ` Paul E. McKenney
2018-08-01 15:24 ` Akira Yokosawa
2018-08-01 15:59 ` Paul E. McKenney
2018-08-01 22:14 ` Akira Yokosawa
2018-08-02 0:22 ` Paul E. McKenney
2018-08-02 22:34 ` [GIT PULL v3] " Akira Yokosawa
2018-08-03 14:35 ` Paul E. McKenney
2018-08-03 15:02 ` Akira Yokosawa
2018-08-03 15:49 ` Akira Yokosawa
2018-08-03 16:45 ` Paul E. McKenney
2018-08-03 23:12 ` Akira Yokosawa
2018-08-03 23:43 ` Paul E. McKenney
2018-08-04 0:00 ` Akira Yokosawa
2018-08-04 11:57 ` [GIT PULL v4] " Akira Yokosawa
2018-08-04 15:15 ` Akira Yokosawa
2018-08-05 0:06 ` [GIT PULL v5] " Akira Yokosawa
2018-08-05 16:35 ` Paul E. McKenney
2018-08-05 16:54 ` Paul E. McKenney
2018-08-05 21:58 ` Akira Yokosawa
2018-08-05 22:47 ` Paul E. McKenney
2018-08-05 23:26 ` Akira Yokosawa
2018-08-05 23:40 ` Paul E. McKenney [this message]
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=20180805234039.GL24813@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akiyks@gmail.com \
--cc=perfbook@vger.kernel.org \
/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