[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add script to generate pooltag.txt for debugger use



Note: script does not correctly handle src/common paths and attributes
  pool tags discovered within to 'common.sys'

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
---
 gentags.ps1 | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 gentags.ps1

diff --git a/gentags.ps1 b/gentags.ps1
new file mode 100644
index 0000000..9c2efa1
--- /dev/null
+++ b/gentags.ps1
@@ -0,0 +1,26 @@
+Function Parse-Tags {
+    param(
+        [string]$drivername
+    )
+
+    Get-ChildItem ("./src/" + $drivername) | Foreach-Object {
+        $file = $_.Name
+        Get-Content $_.FullName | ForEach {
+            if ($_.Contains("TAG") -And $_.Contains("#define")) {
+                $vals = $_.Split(' ', 3)
+                $name = $vals[1].Trim()
+                $tags = $vals[2].Trim().Trim("'").PadRight(4)
+                Write-Host "TAG:" $name "=" $tags
+                $driver = ($drivername + ".sys").PadRight(16)
+                ($tags + " - " + $driver + " - XEN " + $drivername + "\" + 
$file + " " + $name) | Add-Content "./pooltag.txt"
+            }
+        }
+    }
+}
+
+if (Test-Path "./pooltag.txt") {
+    Remove-Item "./pooltag.txt"
+}
+Get-ChildItem "./src" | ?{$_.PSIsContainer}  | ForEach-Object {
+    Parse-Tags $_.Name
+}
-- 
2.41.0.windows.3




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.