From bdb218cb0f65834bf4e682f0dca731abae5e6325 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 15 Sep 2022 16:59:15 -0700 Subject: [PATCH] doc update --- docs/parsers/proc_mtrr.md | 111 ++++++++++++++++++++++++++++++++++++++ man/jc.1 | 5 ++ 2 files changed, 116 insertions(+) create mode 100644 docs/parsers/proc_mtrr.md diff --git a/docs/parsers/proc_mtrr.md b/docs/parsers/proc_mtrr.md new file mode 100644 index 00000000..d6e905ab --- /dev/null +++ b/docs/parsers/proc_mtrr.md @@ -0,0 +1,111 @@ +[Home](https://kellyjonbrazil.github.io/jc/) + + +# jc.parsers.proc\_mtrr + +jc - JSON Convert `/proc/mtrr` file parser + +Usage (cli): + + $ cat /proc/mtrr | jc --proc + +or + + $ jc /proc/mtrr + +or + + $ cat /proc/mtrr | jc --proc-mtrr + +Usage (module): + + import jc + result = jc.parse('proc', proc_mtrr_file) + +or + + import jc + result = jc.parse('proc_mtrr', proc_mtrr_file) + +Schema: + + [ + { + "register": string, + "type": string, + "base": string, + "base_mb": integer, + "size": integer, + "count": integer, + "": string # additional key/values are strings + } + ] + +Examples: + + $ cat /proc/mtrr | jc --proc -p + [ + { + "register": "reg00", + "type": "write-back", + "base": "0x000000000", + "base_mb": 0, + "size": 2048, + "count": 1 + }, + { + "register": "reg01", + "type": "write-back", + "base": "0x080000000", + "base_mb": 2048, + "size": 1024, + "count": 1 + }, + ... + ] + + $ cat /proc/mtrr | jc --proc_mtrr -p -r + [ + { + "register": "reg00", + "type": "write-back", + "base": "0x000000000", + "base_mb": "0", + "size": "2048MB", + "count": "1" + }, + { + "register": "reg01", + "type": "write-back", + "base": "0x080000000", + "base_mb": "2048", + "size": "1024MB", + "count": "1" + }, + ... + ] + + + +### parse + +```python +def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict] +``` + +Main text parsing function + +Parameters: + + data: (string) text data to parse + raw: (boolean) unprocessed output if True + quiet: (boolean) suppress warning messages if True + +Returns: + + List of Dictionaries. Raw or processed structured data. + +### Parser Information +Compatibility: linux + +Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/man/jc.1 b/man/jc.1 index 0a41ffe5..251f6bcf 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -485,6 +485,11 @@ PLIST file parser \fB--proc-modules\fP `/proc/modules` file parser +.TP +.B +\fB--proc-mtrr\fP +`/proc/mtrr` file parser + .TP .B \fB--ps\fP