1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

doc update

This commit is contained in:
Kelly Brazil
2022-09-15 16:59:15 -07:00
parent e4e07b76ec
commit bdb218cb0f
2 changed files with 116 additions and 0 deletions

111
docs/parsers/proc_mtrr.md Normal file
View File

@ -0,0 +1,111 @@
[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.proc_mtrr"></a>
# 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,
"<key>": 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"
},
...
]
<a id="jc.parsers.proc_mtrr.parse"></a>
### 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)

View File

@ -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