iovisor / iovisor/bcc

need opinions on the digraph in libbpf-tools/deadlock

Open
#4,096 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

I have a working CO-RE deadlock that is based on deadlock.py.
Deadlock tool requires different data structures and algorithms, such as digraph, hash map, etc.
Now that all libbpf-tools are built in C, my deadlock code is also written in C.
However, I couldn't find any C-based digraph open source that satisfies all the requirements of the deadlock.
So for now I've been using a simple C digraph with auxiliary code to support dynamic graph sizes, arbitrary data types and values. And additionally, I used an open source hash map.
However, I think the current code is a bit complicated and not good for code maintenance.
So I'm looking for your opinions on the use of various algorithms like digraph and hashmap in libbpf-tools.
There are several candidates.

1. use simple C digraph + auxiliary code to support dynamic graph sizes, arbitrary data types and values. (my current version)
graph: simple C graph like https://kalkicode.com/detect-cycle-in-directed-graph-using-bfs-in-c + auxiliary code
hash: uthash (https://github.com/troydhanson/uthash)

2. use stdlibc++ and opensource digraph based on c++
graph: https://github.com/grame-cncm/digraph
hash: stdlibc++ (stl)
I roughly checked and the C++ graph above meets all the deadlock requirements like networkx used in deadlock.py.
and I checked deadlock.cpp can be compiled with some modifications of libbpf-tools/Makefile.

3. use a C-based digraph that supports all deadlock needs. (I don't have it now.)

Which one do you prefer more?
After more checking, is it ok to choose the second if I want?
Any comments are welcome.
Please let me know if you need more information.
Thank you.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.