Skip to content

Commit

Permalink
Merge pull request #20 from amorenoz/r_0.7
Browse files Browse the repository at this point in the history
Bump release
  • Loading branch information
amorenoz authored Sep 7, 2021
2 parents 5116e73 + 2ee521c commit 8caa916
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 3 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,35 @@ Scripts to help debug OVS and OVN

Full documentation here: https://ovs-dbg.readthedocs.io/en/latest

# Install
Latest released version:

pip install ovs-dbg

From the git checkout

pip install .


# Available tools
## ofparse

Ofparse parses the output of commands such as `ovs-ofproto dump-flows` and
prints the files in different outputs
`ofparse` parses the output of commands such as `ovs-ofproto dump-flows` and
prints the files in different outputs including json and html. It suports
formatting and filtering.

ofparse --help

## ovs-lgrep

`ovs-lgrep` helps you grep though many OVS log files to find interleaving the results to help you find what happened on a OVS/OVN cluster

ovs-lgrep --help

## offline-dbg
`offline-dbg` is a script that locally recreates a running OVS so you can debug offline (including running `ovs-appctl ofproto/trace`)

offline-dbg

# Contribute
PRs are welcome!
120 changes: 120 additions & 0 deletions docs/source/ofparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ When printing a logical representation of a flow list, flows are grouped into *l
- match on the same fields (regardless of the match value)
- execute the same actions (regardless of the actions' arguments)


HTML representation
*******************
Use the *html* option to print an interactive flow table in html

::

ofparse openflow html > /myflows.html

-----------------
DPIF Flow parsing
-----------------
Expand All @@ -139,6 +148,32 @@ The openflow flow parsing supports this extra formats:
ofparse datapath logic


HTML representation
*******************
Use the *html* option to print an interactive flow table in html

::

ofparse datapath html > myflows.html


Graph representation
********************
Use the *graph* option to print a graphviz graph of the datapath. Flows are
sorted by their *recirc_id* to better understand the datapath's logic.

::

ofparse datapath graph | dot -Tsvg > myflows.svg


Use the additional **-h** flag to show the graph in a html page alongside the interactive flow table

::

ofparse datapath graph --html > myflows.html


---------
Filtering
---------
Expand Down Expand Up @@ -176,6 +211,91 @@ Examples:



----------
Formatting
----------
Formatting can be configured by modifying the *ofparse.conf* file provided as
part of the distribution (python egg).

Formatting options are placed under **[style.{style_name}]** section in the config file. Styles can then be selected using **--style** flag.

For instance, if you want to create your predefined style called "foo", edit
config file to show:

::

[style.foo]
...

and then run:

::

ofparse --style=foo ....


Console formatting
******************

To modify how flows are printed in the console, add configuration entries using
the following format:

::

console.{substring_identifier}.[color | underline] = {value}

- **The substring identidier** can have the following keys:
- *[key | value | flag | delim | default]* to select whether the key, the value, the standalone key (flag), the delimiters (such as '(') or the "rest" of the string respectively.
- *{key_name}*: to specify a key match
- *type.{type_name}* to specify a value type (the use of complex types such as 'IPAddress', 'IPMask', 'EthMask' are supported)
- *highlighted* if the style is to be applied when the key is highlighted
- **color** options must have values matching CSS-style colors, eg: #ff00ff, red.
- **underline** options must have values "true" or "false"


Examples:

::

# set default colors:
console.key.color = #5D86BA
console.value.color= #B0C4DE
console.delim.color= #B0C4DE
console.default.color= #FFFFFF
console.flag.color = #875fff

# defaults for special types
console.value.type.IPAddress.color = #008700
console.value.type.IPMask.color = #008700
console.value.type.EthMask.color = #008700

# dim some values that can be quite long arguments
console.value.ct.color = bright_black
console.value.ufid.color = #870000
console.value.clone.color = bright_black
console.value.controller.color = bright_black

# show drop and recirculations
console.key.drop.color = red
console.key.resubmit.color = #00d700
console.key.output.color = #00d700
console.value.output.color = #00d700

# highlights
console.key.highlighted.color = #f20905
console.key.highlighted.underline = true
console.value.highlighted.underline = true
console.delim.highlighted.underline = true


HTML Formatting
***************
HTML Formatting is very uses the same substring identifiers as the console formatting.

The only difference is that *underline* is not supported.



.. _ovs-actions: http://www.openvswitch.org/support/dist-docs/ovs-actions.7.html
.. _ovs-fields: http://www.openvswitch.org/support/dist-docs/ovs-fields.7.html
.. _ovs-ofctl: http://www.openvswitch.org/support/dist-docs/ovs-ofctl.8.txt
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@
packages=find_packages(include=["ovs_dbg", "ovs_dbg.ofparse"]),
setup_requires=setup_requirements,
scripts=["bin/ofparse", "bin/ovs-lgrep"],
data_files=["ovs_dbg/ofparse/ofparse.conf"],
test_suite="tests",
tests_require=test_requirements,
url="https://ovs-dbg.readthedocs.io/en/latest/",
project_urls={
"Source": "https://github.com/amorenoz/ovs-dbg",
},
version="0.0.6",
version="0.0.7",
zip_safe=False,
)

0 comments on commit 8caa916

Please sign in to comment.