summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorXabier Marquiegui <reibax@gmail.com>2023-10-12 01:39:57 +0300
committerDavid S. Miller <davem@davemloft.net>2023-10-15 22:07:52 +0300
commit403376ddb4221be9db5326ae334773807df71ffe (patch)
tree027d7c1055733aecd925d4941b8a7d90296e57f6 /tools
parentc5a445b1e9347b14752b01f1a304bd7a2f260acc (diff)
downloadlinux-403376ddb4221be9db5326ae334773807df71ffe.tar.xz
ptp: add debugfs interface to see applied channel masks
Use debugfs to be able to view channel mask applied to every timestamp event queue. Every time the device is opened, a new entry is created in `$DEBUGFS_MOUNTPOINT/ptpN/$INSTANCE_ADDRESS/mask`. The mask value can be viewed grouped in 32bit decimal values using cat, or converted to hexadecimal with the included `ptpchmaskfmt.sh` script. 32 bit values are listed from least significant to most significant. Signed-off-by: Xabier Marquiegui <reibax@gmail.com> Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/ptp/ptpchmaskfmt.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/testing/selftests/ptp/ptpchmaskfmt.sh b/tools/testing/selftests/ptp/ptpchmaskfmt.sh
new file mode 100644
index 000000000000..0a06ba8af300
--- /dev/null
+++ b/tools/testing/selftests/ptp/ptpchmaskfmt.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+# Simple helper script to transform ptp debugfs timestamp event queue filtering
+# masks from decimal values to hexadecimal values
+
+# Only takes the debugfs mask file path as an argument
+DEBUGFS_MASKFILE="${1}"
+
+#shellcheck disable=SC2013,SC2086
+for int in $(cat "$DEBUGFS_MASKFILE") ; do
+ printf '0x%08X ' "$int"
+done
+echo