ASoC: dapm-graph: show path name for non-static routes

Many routes are just static, not modifiable at runtime. Show the route name
for all the other routes as an edge label in the generated graph.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20240823-dapm-graph-v1-3-989a47308c4c@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Luca Ceresoli 2024-08-23 09:46:01 +02:00 committed by Mark Brown
parent 64a1e3ddab
commit a14b278a47
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -134,11 +134,17 @@ process_dapm_widget()
# Collect any links. We could use "in" links or "out" links, # Collect any links. We could use "in" links or "out" links,
# let's use "in" links # let's use "in" links
if echo "${line}" | grep -q '^in '; then if echo "${line}" | grep -q '^in '; then
local w_route=$(echo "$line" | awk -F\" '{print $2}')
local w_src=$(echo "$line" | local w_src=$(echo "$line" |
awk -F\" '{print $6 "_" $4}' | awk -F\" '{print $6 "_" $4}' |
sed 's/^(null)_/ROOT_/') sed 's/^(null)_/ROOT_/')
dbg_echo " - Input route from: ${w_src}" dbg_echo " - Input route from: ${w_src}"
echo " \"${w_src}\" -> \"$w_tag\"" >> "${links_file}" dbg_echo " - Route: ${w_route}"
local w_edge_attrs=""
if [ "${w_route}" != "static" ]; then
w_edge_attrs=" [label=\"${w_route}\"]"
fi
echo " \"${w_src}\" -> \"$w_tag\"${w_edge_attrs}" >> "${links_file}"
fi fi
done done
@ -220,7 +226,7 @@ process_dapm_tree()
echo "digraph G {" > "${dot_file}" echo "digraph G {" > "${dot_file}"
echo " fontname=\"sans-serif\"" >> "${dot_file}" echo " fontname=\"sans-serif\"" >> "${dot_file}"
echo " node [fontname=\"sans-serif\"]" >> "${dot_file}" echo " node [fontname=\"sans-serif\"]" >> "${dot_file}"
echo " edge [fontname=\"sans-serif\"]" >> "${dot_file}"
# Process root directory (no component) # Process root directory (no component)
process_dapm_component "${tmp_dir}" "${dapm_dir}/dapm" "ROOT" process_dapm_component "${tmp_dir}" "${dapm_dir}/dapm" "ROOT"