Messages in this thread Patch in this message | | | Date | Wed, 3 Feb 1999 17:42:37 +0100 (MET) | From | Max <> | Subject | [PATCH] ksymoops speedup (Was: ksymoops deadly slow) |
| |
Ok, I'm replying to my own message on linux-kernel.
>I tried to use the ksymoops included in 2.2.1 to get info about some Oopses >I got on my old 486, but it seemed to hang forever after it got the >"Code: <hex numbers>" line.
I checked it better. It did a 5-6 minutes hang in CPU eating state. Then it worked.
> >So I tried it on a faster machine (a 266MHz PII) and it froze for more than >20 seconds, then finally printed the disassembled code and all normal info. > >I tracked this down to the following code in Oops_read (oops.c, line 960) : > > re_compile(&re_Oops_code, > "^(" /* 1 */ > /* sparc */ "(Instruction DUMP)" /* 2 */ > /* various */ "|(Code *)" /* 3 */ > ")" > ":[ \t]+" > "(" /* 4 */ > "(general protection.*)" > "|(<[0-9]+>)" > "|(([<(]?[0-9a-fA-F]+[>)]?[ \t]*)+)" > ")" > "(.*)$" /* trailing garbage */ > , > REG_NEWLINE|REG_EXTENDED|REG_ICASE, > &re_Oops_code_pmatch); > >[...] >Thinking a little, I suspect that the regex expression >"|(([<(]?[0-9a-fA-F]+[>)]?[ \t]*)+)" is the guilty one >[...]
I was right, and I fixed the problem. Now ksymoops *flies* even on my 486 (the startup is still a little slow, but that's because it sucks up zillion of data from kernel, modules, etc.)
Here's the patch against linux 2.2.1. With it, the 5-6 minutes freeze I got on my 486 turned into a 3-4 seconds one.
----------------------- cut here --------------------------------------------- diff -ur linux-vanilla/scripts/ksymoops/oops.c linux/scripts/ksymoops/oops.c --- linux-vanilla/scripts/ksymoops/oops.c Mon Jan 11 10:09:39 1999 +++ linux/scripts/ksymoops/oops.c Wed Feb 3 03:59:50 1999 @@ -976,7 +976,7 @@ "(" /* 4 */ "(general protection.*)" "|(<[0-9]+>)" - "|(([<(]?[0-9a-fA-F]+[>)]?[ \t]*)+)" + "|(([<(]?[0-9a-fA-F]+[>)]?[ \t]+)+[<(]?[0-9a-fA-F]+[>)]?)" ")" "(.*)$" /* trailing garbage */ , ---------------------------- cut here ----------------------------------------- Bye,
Massimiliano Ghilardi
---------------------------------------------------------------- | I have yet to meet a person who had a bad experience of Linux. | | Most have never had an experience. | ----------------------------------------------------------------
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |