formal: Move data dir to CodeSamples/fomral/data
cover formal: Move data dir to CodeSamples/fomral/data
Hi Paul,
So this patch set moves formal/data and formal/RCU-test-ratio.eps to CodeSamples/formal/data.
Patch 1/2 does the movement.
Patch 2/2 puts symlink to the moved .eps file under formal/.
Actually, patch 2/2 is optional within the scope of this set. It presents an idea of organizing .eps files generated by gnuplot under CodeSamples/ so that redundant .eps -> .pdf conversions can be avoided.
Currently, I observe three ways to include gnuplot outputs.
1) Copy generated .eps files manually to the relevant chapter's subdirectory (after running the plot script).
2) Run a plot script under CodeSamples/ and the generated .eps files are automatically copied by commands in the script.
3) Use paths of .pdf versions of .eps files under CodeSamples/... as the argument to the \includegraphics{} macros (no copying involved).
Most recent plots are managed by 3).
However, to accommodate 3), a wildcard pattern in Makefile was extended to include deep subdirectories under CodeSamples/ (commit 57b442c02db3 "Makefile: Extend wildcard pattern to catch .eps files under CodeSamples").
So it now picks up a lot of unused older gnuplot plots, and causes redundant .eps -> .pdf conversions.
So, I suggest using symlink, e.g.,
formal/xxx.eps -> CodeSamples/formal/data/xxx.eps, and remove CodeSamples/ from the wildcard pattern in Makefile.
That is, if it is OK to use symlink as in patch 2/2.
Another advantage of this idea is that it would be easier to find out where a particular gnuplot image is originated.
By copying .eps files from CodeSamples/... to other directories, you lose such origin info. This won't be a issue if there is a single .eps file of the same name under CodeSamples/, but this is not always the case.
Symlinks can retain their origins.
So, for example, when Zhouyi changed "rcu" to "RCU" in gnuplot generated plots (commit 2a2ca773005f "Change trace labels from "rcu" to "RCU""), he could have find out which scripts need updates more easily.
As a matter of fact, he failed to update .eps files under CodeSamples/. For example:
$ diff -u CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps defer/refRCUperfPREEMPT.eps
--- CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps 2021-08-12 13:48:28.580153786 +0900
+++ defer/refRCUperfPREEMPT.eps 2021-08-17 13:14:58.114517535 +0900
@@ -2209,7 +2209,7 @@
1.000 UP
LCb setrgbcolor
1729 1458 M
-[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (rcu)]
+[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (RCU)]
] -33.3 MLshow
LCb setrgbcolor
1066 2212 MIf Patch 2/2 looks good to you, I'll do the changes along this idea and update the wildcard pattern in Makefile.
Thanks, Akira
--
Akira Yokosawa (2):
formal: Move formal/data to CodeSamples/formal/data
formal: Use symlink to .eps file under CodeSamples/formal/data
.../formal}/data/.gitignore | 1 -
CodeSamples/formal/data/RCU-test-ratio.eps | 4370 ++++++++++++++++
{formal => CodeSamples/formal}/data/plot.sh | 2 -
.../formal}/data/rcu-test.dat | 0
formal/RCU-test-ratio.eps | 4371 +----------------
5 files changed, 4371 insertions(+), 4373 deletions(-)
rename {formal => CodeSamples/formal}/data/.gitignore (50%)
create mode 100644 CodeSamples/formal/data/RCU-test-ratio.eps
rename {formal => CodeSamples/formal}/data/plot.sh (96%)
rename {formal => CodeSamples/formal}/data/rcu-test.dat (100%)
mode change 100644 => 120000 formal/RCU-test-ratio.epsSignature · 1 line
2.17.1
PATCH 1/2 formal: Move formal/data to CodeSamples/formal/data
The "data" directory with the plot script should be near the script used to obtain the data.
Also adjust path in \includegraphics{} and remove a copy command in plot.sh.
---
Note: Trailing spaces in the .eps file as generated by gnuplot is kept intact.
Thanks, Akira
--
{formal => CodeSamples/formal}/data/.gitignore | 1 -
{formal => CodeSamples/formal/data}/RCU-test-ratio.eps | 0
{formal => CodeSamples/formal}/data/plot.sh | 2 --
{formal => CodeSamples/formal}/data/rcu-test.dat | 0
formal/formal.tex | 4 ++--
5 files changed, 2 insertions(+), 5 deletions(-)
rename {formal => CodeSamples/formal}/data/.gitignore (50%)
rename {formal => CodeSamples/formal/data}/RCU-test-ratio.eps (100%)
rename {formal => CodeSamples/formal}/data/plot.sh (96%)
rename {formal => CodeSamples/formal}/data/rcu-test.dat (100%)CodeSamples/formal/data/.gitignore renamed from formal/data/.gitignore +0 -1
@@ -1,2 +1 @@ -*.eps *.pdf
CodeSamples/formal/data/RCU-test-ratio.eps renamed from formal/RCU-test-ratio.eps +0 -0
CodeSamples/formal/data/plot.sh renamed from formal/data/plot.sh +0 -2
@@ -41,5 +41,3 @@ set style line 2 \ plot 'rcu-test.dat' using 2 t "RCU", '' using 3:xticlabels(1) t "RCU Test", \ '' using 5 with line linestyle 2 axis x1y2 t "\% Test" ---EOF--- - -cp RCU-test-ratio.eps ../RCU-test-ratio.eps
CodeSamples/formal/data/rcu-test.dat renamed from formal/data/rcu-test.dat +0 -0
formal/formal.tex +2 -2
@@ -318,9 +318,9 @@ can help reduce the cost of finding and fixing any bugs located. \begin{figure} \centering \IfEbookSize{ -\resizebox{\onecolumntextwidth}{!}{\includegraphics{formal/RCU-test-ratio.pdf}} +\resizebox{\onecolumntextwidth}{!}{\includegraphics{CodeSamples/formal/data/RCU-test-ratio.pdf}} }{ -\resizebox{4.5in}{!}{\includegraphics{formal/RCU-test-ratio.pdf}} +\resizebox{4.5in}{!}{\includegraphics{CodeSamples/formal/data/RCU-test-ratio.pdf}} } \caption{Linux-Kernel RCU Test Code} \label{fig:formal:Linux-Kernel RCU Test Code}
Signature · 1 line
2.17.1
PATCH 2/2 formal: Use symlink to .eps file under CodeSamples/formal/data
In reply to Akira YokosawaThis is a preparatory change of planned reduction of conversions from .eps to .pdf.
The goal is to exclude unused plots under CodeSamples/ from conversions by a2ping.
--- formal/RCU-test-ratio.eps | 1 + formal/formal.tex | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 120000 formal/RCU-test-ratio.eps
formal/RCU-test-ratio.eps new file +1 -0
@@ -0,0 +1 @@ +../CodeSamples/formal/data/RCU-test-ratio.eps
formal/formal.tex +2 -2
@@ -318,9 +318,9 @@ can help reduce the cost of finding and fixing any bugs located. \begin{figure} \centering \IfEbookSize{ -\resizebox{\onecolumntextwidth}{!}{\includegraphics{CodeSamples/formal/data/RCU-test-ratio.pdf}} +\resizebox{\onecolumntextwidth}{!}{\includegraphics{formal/RCU-test-ratio.pdf}} }{ -\resizebox{4.5in}{!}{\includegraphics{CodeSamples/formal/data/RCU-test-ratio.pdf}} +\resizebox{4.5in}{!}{\includegraphics{formal/RCU-test-ratio.pdf}} } \caption{Linux-Kernel RCU Test Code} \label{fig:formal:Linux-Kernel RCU Test Code}
Signature · 1 line
2.17.1
Quoted 18 lines · Akira Yokosawa
Hi Paul,
So this patch set moves formal/data and formal/RCU-test-ratio.eps to CodeSamples/formal/data.
Patch 1/2 does the movement.
Patch 2/2 puts symlink to the moved .eps file under formal/.Actually, patch 2/2 is optional within the scope of this set. It presents an idea of organizing .eps files generated by gnuplot under CodeSamples/ so that redundant .eps -> .pdf conversions can be avoided.
Currently, I observe three ways to include gnuplot outputs.
1) Copy generated .eps files manually to the relevant chapter's subdirectory (after running the plot script).
Quoted 8 lines
2) Run a plot script under CodeSamples/ and the generated .eps files are automatically copied by commands in the script.
3) Use paths of .pdf versions of .eps files under CodeSamples/... as the argument to the \includegraphics{} macros (no copying involved).
Most recent plots are managed by 3).
Good point! I moved (partially, as you noted) to #3 in part because #1 and #2 make it annoying to work out where the generated .eps came from.
Quoted 6 lines
However, to accommodate 3), a wildcard pattern in
Makefilewas extended to include deep subdirectories under CodeSamples/ (commit57b442c02db3"Makefile: Extend wildcard pattern to catch .eps files under CodeSamples").
So it now picks up a lot of unused older gnuplot plots, and causes redundant .eps -> .pdf conversions.
And you are right, that is definitely not a good thing. And it just gets worse over time as more data is regenerated.
Quoted 5 lines
So, I suggest using symlink, e.g.,
formal/xxx.eps -> CodeSamples/formal/data/xxx.eps, and remove CodeSamples/ from the wildcard pattern inMakefile.That is, if it is OK to use symlink as in patch 2/2.
I would prefer to avoid quite that many symlinks.
Quoted 2 lines
Another advantage of this idea is that it would be easier to find out where a particular gnuplot image is originated.
Exactly! Both #3 and symlink do that. In #3, you just look at the latex for the figure, and with the symlink, just run "ls -l".
Quoted 28 lines
By copying .eps files from CodeSamples/... to other directories, you lose such origin info. This won't be a issue if there is a single .eps file of the same name under CodeSamples/, but this is not always the case.
Symlinks can retain their origins.
So, for example, when Zhouyi changed "rcu" to "RCU" in gnuplot generated plots (commit
2a2ca773005f"Change trace labels from "rcu" to "RCU""), he could have find out which scripts need updates more easily.As a matter of fact, he failed to update .eps files under CodeSamples/. For example:
$ diff -u CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps defer/refRCUperfPREEMPT.eps --- CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps 2021-08-12 13:48:28.580153786 +0900 +++ defer/refRCUperfPREEMPT.eps 2021-08-17 13:14:58.114517535 +0900 @@ -2209,7 +2209,7 @@ 1.000 UP LCb setrgbcolor 1729 1458 M -[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (rcu)] +[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (RCU)] ] -33.3 MLshow LCb setrgbcolor 1066 2212 M
Quoted 2 lines
If Patch 2/2 looks good to you, I'll do the changes along this idea and update the wildcard pattern in
Makefile.
How about if I "git mv" the directories containing old data to some name starting (say) with "OLD-", so that the hash.2013.12.02a directory within CodeSamples/datastruct/hash/data becomes OLD-hash.2013.12.02a? Then the Makefile could ignore .eps files in directories starting with "OLD-"? And yes, would probably be an annoying change to the Makefile. The only way I know to do it is to automatically generate that portion of the Makefile and include it. :-/
Or is there a better way?
(For the moment, I will apply 1/2, and thank you!)
Thanx, Paul
Quoted 21 lines
Thanks, Akira
--
Akira Yokosawa (2):
formal: Move formal/data to CodeSamples/formal/data
formal: Use symlink to .eps file under CodeSamples/formal/data.../formal}/data/.gitignore | 1 - CodeSamples/formal/data/RCU-test-ratio.eps | 4370 ++++++++++++++++ {formal => CodeSamples/formal}/data/plot.sh | 2 - .../formal}/data/rcu-test.dat | 0 formal/RCU-test-ratio.eps | 4371 +---------------- 5 files changed, 4371 insertions(+), 4373 deletions(-) rename {formal => CodeSamples/formal}/data/.gitignore (50%) create mode 100644 CodeSamples/formal/data/RCU-test-ratio.eps rename {formal => CodeSamples/formal}/data/plot.sh (96%) rename {formal => CodeSamples/formal}/data/rcu-test.dat (100%) mode change 100644 => 120000 formal/RCU-test-ratio.epsSignature · 1 line
2.17.1
Quoted 41 lines · Paul E. McKenney
Quoted 18 lines · Akira Yokosawa
Hi Paul,
So this patch set moves formal/data and formal/RCU-test-ratio.eps to CodeSamples/formal/data.
Patch 1/2 does the movement.
Patch 2/2 puts symlink to the moved .eps file under formal/.Actually, patch 2/2 is optional within the scope of this set. It presents an idea of organizing .eps files generated by gnuplot under CodeSamples/ so that redundant .eps -> .pdf conversions can be avoided.
Currently, I observe three ways to include gnuplot outputs.
1) Copy generated .eps files manually to the relevant chapter's subdirectory (after running the plot script).
Quoted 8 lines
2) Run a plot script under CodeSamples/ and the generated .eps files are automatically copied by commands in the script.
3) Use paths of .pdf versions of .eps files under CodeSamples/... as the argument to the \includegraphics{} macros (no copying involved).
Most recent plots are managed by 3).
Good point! I moved (partially, as you noted) to #3 in part because #1 and #2 make it annoying to work out where the generated .eps came from.
Quoted 6 lines
However, to accommodate 3), a wildcard pattern in
Makefilewas extended to include deep subdirectories under CodeSamples/ (commit57b442c02db3"Makefile: Extend wildcard pattern to catch .eps files under CodeSamples").
So it now picks up a lot of unused older gnuplot plots, and causes redundant .eps -> .pdf conversions.And you are right, that is definitely not a good thing. And it just gets worse over time as more data is regenerated.
Quoted 7 lines
Quoted 5 lines
So, I suggest using symlink, e.g.,
formal/xxx.eps -> CodeSamples/formal/data/xxx.eps, and remove CodeSamples/ from the wildcard pattern inMakefile.That is, if it is OK to use symlink as in patch 2/2.
I would prefer to avoid quite that many symlinks.
I see.
Quoted 38 lines
Quoted 3 lines
Another advantage of this idea is that it would be easier to find out where a particular gnuplot image is originated.
Exactly! Both #3 and symlink do that. In #3, you just look at the latex for the figure, and with the symlink, just run "ls -l".
Quoted 28 lines
By copying .eps files from CodeSamples/... to other directories, you lose such origin info. This won't be a issue if there is a single .eps file of the same name under CodeSamples/, but this is not always the case.
Symlinks can retain their origins.
So, for example, when Zhouyi changed "rcu" to "RCU" in gnuplot generated plots (commit
2a2ca773005f"Change trace labels from "rcu" to "RCU""), he could have find out which scripts need updates more easily.As a matter of fact, he failed to update .eps files under CodeSamples/. For example:
$ diff -u CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps defer/refRCUperfPREEMPT.eps --- CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps 2021-08-12 13:48:28.580153786 +0900 +++ defer/refRCUperfPREEMPT.eps 2021-08-17 13:14:58.114517535 +0900 @@ -2209,7 +2209,7 @@ 1.000 UP LCb setrgbcolor 1729 1458 M -[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (rcu)] +[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (RCU)] ] -33.3 MLshow LCb setrgbcolor 1066 2212 MQuoted 2 lines
If Patch 2/2 looks good to you, I'll do the changes along this idea and update the wildcard pattern in
Makefile.
Quoted 7 lines
How about if I "git mv" the directories containing old data to some name starting (say) with "OLD-", so that the hash.2013.12.02a directory within CodeSamples/datastruct/hash/data becomes OLD-hash.2013.12.02a? Then the
Makefilecould ignore .eps files in directories starting with "OLD-"? And yes, would probably be an annoying change to theMakefile. The only way I know to do it is to automatically generate that portion of theMakefileand include it. :-/
I think gnu-make's wildcard function can contain the pattern of (say):
CodeSamples/*/*/OLD-*/*.eps
This will match the .eps files under OLD-hash.2013.12.02a. A few more additional patterns can make a list of .eps files to be ignored.
Then the list of latest .eps files can be made by the "filter-out" function.
So your idea should work without that annoying change to the Makefile.
Paul, please go ahead and "git mv" to the "OLD-" directories.
I will update the Makefile as a follow-up change.
Thanks, Akira
Quoted 28 lines
Or is there a better way?
(For the moment, I will apply 1/2, and thank you!)
Thanx, Paul
Quoted 21 lines
Thanks, Akira
--
Akira Yokosawa (2):
formal: Move formal/data to CodeSamples/formal/data
formal: Use symlink to .eps file under CodeSamples/formal/data.../formal}/data/.gitignore | 1 - CodeSamples/formal/data/RCU-test-ratio.eps | 4370 ++++++++++++++++ {formal => CodeSamples/formal}/data/plot.sh | 2 - .../formal}/data/rcu-test.dat | 0 formal/RCU-test-ratio.eps | 4371 +---------------- 5 files changed, 4371 insertions(+), 4373 deletions(-) rename {formal => CodeSamples/formal}/data/.gitignore (50%) create mode 100644 CodeSamples/formal/data/RCU-test-ratio.eps rename {formal => CodeSamples/formal}/data/plot.sh (96%) rename {formal => CodeSamples/formal}/data/rcu-test.dat (100%) mode change 100644 => 120000 formal/RCU-test-ratio.epsSignature · 1 line
2.17.1
Quoted 102 lines · Akira Yokosawa
Quoted 41 lines · Paul E. McKenney
Quoted 18 lines · Akira Yokosawa
Hi Paul,
So this patch set moves formal/data and formal/RCU-test-ratio.eps to CodeSamples/formal/data.
Patch 1/2 does the movement.
Patch 2/2 puts symlink to the moved .eps file under formal/.Actually, patch 2/2 is optional within the scope of this set. It presents an idea of organizing .eps files generated by gnuplot under CodeSamples/ so that redundant .eps -> .pdf conversions can be avoided.
Currently, I observe three ways to include gnuplot outputs.
1) Copy generated .eps files manually to the relevant chapter's subdirectory (after running the plot script).
Quoted 8 lines
2) Run a plot script under CodeSamples/ and the generated .eps files are automatically copied by commands in the script.
3) Use paths of .pdf versions of .eps files under CodeSamples/... as the argument to the \includegraphics{} macros (no copying involved).
Most recent plots are managed by 3).
Good point! I moved (partially, as you noted) to #3 in part because #1 and #2 make it annoying to work out where the generated .eps came from.
Quoted 6 lines
However, to accommodate 3), a wildcard pattern in
Makefilewas extended to include deep subdirectories under CodeSamples/ (commit57b442c02db3"Makefile: Extend wildcard pattern to catch .eps files under CodeSamples").
So it now picks up a lot of unused older gnuplot plots, and causes redundant .eps -> .pdf conversions.And you are right, that is definitely not a good thing. And it just gets worse over time as more data is regenerated.
Quoted 7 lines
Quoted 5 lines
So, I suggest using symlink, e.g.,
formal/xxx.eps -> CodeSamples/formal/data/xxx.eps, and remove CodeSamples/ from the wildcard pattern inMakefile.That is, if it is OK to use symlink as in patch 2/2.
I would prefer to avoid quite that many symlinks.
I see.
Quoted 38 lines
Quoted 3 lines
Another advantage of this idea is that it would be easier to find out where a particular gnuplot image is originated.
Exactly! Both #3 and symlink do that. In #3, you just look at the latex for the figure, and with the symlink, just run "ls -l".
Quoted 28 lines
By copying .eps files from CodeSamples/... to other directories, you lose such origin info. This won't be a issue if there is a single .eps file of the same name under CodeSamples/, but this is not always the case.
Symlinks can retain their origins.
So, for example, when Zhouyi changed "rcu" to "RCU" in gnuplot generated plots (commit
2a2ca773005f"Change trace labels from "rcu" to "RCU""), he could have find out which scripts need updates more easily.As a matter of fact, he failed to update .eps files under CodeSamples/. For example:
$ diff -u CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps defer/refRCUperfPREEMPT.eps --- CodeSamples/defer/data/rcuscale.hps.2020.05.28a/refRCUperfPREEMPT.eps 2021-08-12 13:48:28.580153786 +0900 +++ defer/refRCUperfPREEMPT.eps 2021-08-17 13:14:58.114517535 +0900 @@ -2209,7 +2209,7 @@ 1.000 UP LCb setrgbcolor 1729 1458 M -[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (rcu)] +[ [(NimbusSanL-Regu) 100.0 0.0 true true 0 (RCU)] ] -33.3 MLshow LCb setrgbcolor 1066 2212 MQuoted 2 lines
If Patch 2/2 looks good to you, I'll do the changes along this idea and update the wildcard pattern in
Makefile.Quoted 7 lines
How about if I "git mv" the directories containing old data to some name starting (say) with "OLD-", so that the hash.2013.12.02a directory within CodeSamples/datastruct/hash/data becomes OLD-hash.2013.12.02a? Then the
Makefilecould ignore .eps files in directories starting with "OLD-"? And yes, would probably be an annoying change to theMakefile. The only way I know to do it is to automatically generate that portion of theMakefileand include it. :-/I think gnu-make's wildcard function can contain the pattern of (say):
CodeSamples/*/*/OLD-*/*.eps
Quoted 8 lines
This will match the .eps files under OLD-hash.2013.12.02a. A few more additional patterns can make a list of .eps files to be ignored.
Then the list of latest .eps files can be made by the "filter-out" function.So your idea should work without that annoying change to the
Makefile.
Even better!
Quoted 1 line
Paul, please go ahead and "git mv" to the "OLD-" directories.
I have done those in CodeSamples/datastruct/hash/data. Does that one work the way that you had in mind?
Quoted 1 line
I will update the
Makefileas a follow-up change.
Sounds good -- if the first commit looks good to you, I will do the rest.
f891fa5c6e8b ("datastruct/hash: Mark directories of unused data")
Thanx, Paul
Quoted 30 lines
Thanks, Akira
Quoted 28 lines
Or is there a better way?
(For the moment, I will apply 1/2, and thank you!)
Thanx, Paul
Quoted 21 lines
Thanks, Akira
--
Akira Yokosawa (2):
formal: Move formal/data to CodeSamples/formal/data
formal: Use symlink to .eps file under CodeSamples/formal/data.../formal}/data/.gitignore | 1 - CodeSamples/formal/data/RCU-test-ratio.eps | 4370 ++++++++++++++++ {formal => CodeSamples/formal}/data/plot.sh | 2 - .../formal}/data/rcu-test.dat | 0 formal/RCU-test-ratio.eps | 4371 +---------------- 5 files changed, 4371 insertions(+), 4373 deletions(-) rename {formal => CodeSamples/formal}/data/.gitignore (50%) create mode 100644 CodeSamples/formal/data/RCU-test-ratio.eps rename {formal => CodeSamples/formal}/data/plot.sh (96%) rename {formal => CodeSamples/formal}/data/rcu-test.dat (100%) mode change 100644 => 120000 formal/RCU-test-ratio.epsSignature · 1 line
2.17.1