git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] grep: under --debug, show whether PCRE JIT is enabled

From
Beat Bolli <dev+git@drbeat.li>
Date
Aug 18, 2019, 20:17 UTC
Message-ID
<20190818201727.31505-1-dev+git@drbeat.li>
This information is useful and not visible anywhere else, so show it.
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>

--- This applies on top of 'ab/pcre-jit-fixes', currently in pu.

 grep.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/grep.c b/grep.c
index 9bc589720b..96272b3cfc 100644
--- a/grep.c
+++ b/grep.c
@@ -433,6 +433,8 @@ static void compile_pcre1_regexp(struct grep_pat *p, const struct grep_opt *opt)
 
 #ifdef GIT_PCRE1_USE_JIT
 	pcre_config(PCRE_CONFIG_JIT, &p->pcre1_jit_on);
+	if (opt->debug)
+		fprintf(stderr, "pcre1_jit_on=%d\n", p->pcre1_jit_on);
 #endif
 }
 
@@ -534,6 +536,8 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
 	}
 
 	pcre2_config(PCRE2_CONFIG_JIT, &p->pcre2_jit_on);
+	if (opt->debug)
+		fprintf(stderr, "pcre2_jit_on=%d\n", p->pcre2_jit_on);
 	if (p->pcre2_jit_on) {
 		jitret = pcre2_jit_compile(p->pcre2_pattern, PCRE2_JIT_COMPLETE);
 		if (jitret)
@@ -559,6 +563,9 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
 			BUG("pcre2_pattern_info() failed: %d", patinforet);
 		if (jitsizearg == 0) {
 			p->pcre2_jit_on = 0;
+			if (opt->debug)
+				fprintf(stderr, "pcre2_jit_on=%d: (*NO_JIT) in regex\n",
+					p->pcre2_jit_on);
 			return;
 		}
 	}
-- 
2.21.0.1020.gf2820cf01a
Next: Junio C Hamano
Message 1 of 8 in “grep: under --debug, show whether PCRE JIT is enabled”
  1. grep: under --debug, show whether PCRE JIT is enabledBeat Bolli, Aug 18, 2019
  2. Junio C HamanoAug 19, 2019
  3. Carlo ArenasAug 24, 2019
  4. Johannes SchindelinAug 26, 2019
  5. Carlo ArenasAug 26, 2019
  6. Junio C HamanoAug 26, 2019
  7. Carlo ArenasAug 26, 2019
  8. Junio C HamanoAug 27, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.