From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Elad Lahav <e2lahav@gmail.com>,
perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH -perfbook] count: Adjust index marker of _Thread_local
Date: Wed, 24 Aug 2022 11:43:38 +0900 [thread overview]
Message-ID: <f96b6945-0727-b9f2-c34b-0c58a508cd92@gmail.com> (raw)
\apic{} is there for ISO C std APIs. Use it.
While we are here, fix a couple of minor nits:
- align //\lnlbl{var:b} in count_end.c;
- not line-break in front of \footnote{}, indent footnote text.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Fixes: 24e8f711d2cf ("count: Switch from GCC to C11 thread-local storage")
Cc: Elad Lahav <e2lahav@gmail.com>
---
CodeSamples/count/count_end.c | 2 +-
count/count.tex | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/CodeSamples/count/count_end.c b/CodeSamples/count/count_end.c
index 5e7b9ee1025c..b6ed851c35a9 100644
--- a/CodeSamples/count/count_end.c
+++ b/CodeSamples/count/count_end.c
@@ -23,7 +23,7 @@
#include "../api.h"
//\begin{snippet}[labelbase=ln:count:count_end:whole,commandchars=\\\@\$]
-unsigned long _Thread_local counter = 0; //\lnlbl{var:b}
+unsigned long _Thread_local counter = 0; //\lnlbl{var:b}
unsigned long *counterp[NR_THREADS] = { NULL };
unsigned long finalcount = 0;
DEFINE_SPINLOCK(final_mutex); //\lnlbl{var:e}
diff --git a/count/count.tex b/count/count.tex
index 775cf77e90a8..b2de4646b18f 100644
--- a/count/count.tex
+++ b/count/count.tex
@@ -721,12 +721,12 @@ This is the topic of the next section.
\subsection{Per-Thread-Variable-Based Implementation}
\label{sec:count:Per-Thread-Variable-Based Implementation}
-The C language, since C11, features a \apig{_Thread_local} storage class that
-provides per-thread storage.
-\footnote{\GCC\ provides its own \apig{__thread} storage class, which was used
-in previous versions of this book.
-The two methods for specifying a thread-local variable are interchangeable
-when using \GCC\@.}
+The C language, since C11, features a \apic{_Thread_local} storage class that
+provides per-thread storage.\footnote{
+ \GCC\ provides its own \apig{__thread} storage class, which was used
+ in previous versions of this book.
+ The two methods for specifying a thread-local variable are
+ interchangeable when using \GCC\@.}
This can be used as shown in
\cref{lst:count:Per-Thread Statistical Counters} (\path{count_end.c})
to implement
base-commit: ba01403b34de88d3060e119f899f5eb053c5f162
--
2.25.1
next reply other threads:[~2022-08-24 2:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 2:43 Akira Yokosawa [this message]
2022-08-24 11:22 ` [PATCH -perfbook] count: Adjust index marker of _Thread_local Elad Lahav
2022-08-24 14:48 ` Paul E. McKenney
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=f96b6945-0727-b9f2-c34b-0c58a508cd92@gmail.com \
--to=akiyks@gmail.com \
--cc=e2lahav@gmail.com \
--cc=paulmck@kernel.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).