diff --git a/Source/AssemblyInfo.cs b/Source/AssemblyInfo.cs index cde0f4e..05e4e35 100644 --- a/Source/AssemblyInfo.cs +++ b/Source/AssemblyInfo.cs @@ -5,5 +5,5 @@ using System.Reflection; [assembly: AssemblyCompany("MS Open Tech")] [assembly: AssemblyProduct("Tx (LINQ to Logs and Traces)")] [assembly: AssemblyCopyright("Copyright © MS Open Tech 2012")] -[assembly: AssemblyVersion("1.0.60301.0")] -[assembly: AssemblyFileVersion("1.0.60301.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.60312.0")] +[assembly: AssemblyFileVersion("1.0.60312.0")] \ No newline at end of file diff --git a/Source/EtwEventTypeGen/Program.cs b/Source/EtwEventTypeGen/Program.cs index 580ad07..cb6f92e 100644 --- a/Source/EtwEventTypeGen/Program.cs +++ b/Source/EtwEventTypeGen/Program.cs @@ -32,7 +32,7 @@ namespace Microsoft.Etw else { string target = Path.Combine(outputDirectory, assembly); - AssemblyBuilder.OutputAssembly(generated, new string[]{}, target); + AssemblyBuilder.OutputAssembly(generated, new string[] { }, target); } } @@ -42,7 +42,7 @@ namespace Microsoft.Etw { Console.WriteLine( @"Usage: - EtwEventTypeGen [/o:dir] [/a:name] [/m:file] [/t:file] [/w:path] + EtwEventTypeGen [/o:dir] [/a:name] [/m:file] [/e:file] [/t:file] [/w:path] Switches: /o:dir Directory for the output. @@ -52,6 +52,7 @@ Switches: If missing the output is C# files. /m:manifest Input from manifest(s) + /e:etl Input from eventsource etl(s) that contain manifests /t:tmf Input from TMF file(s) /p:file.blg Input from performance counter trace @@ -121,6 +122,51 @@ Examples: } break; + case "/e:": + string[] etlFiles; + string etlDir = Path.GetDirectoryName(value); + if (String.IsNullOrEmpty(etlDir)) + { + etlFiles = Directory.GetFiles(".", value); + } + else + { + etlFiles = Directory.GetFiles( + etlDir, + Path.GetFileName(value)); + } + + foreach (string etlFile in etlFiles) + { + string[] etlManifests = ManifestParser.ExtractFromTrace(etlFile); + + if (etlManifests != null && etlManifests.Length > 0) + { + int i = 0; + foreach (string content in etlManifests) + { + Dictionary code = ManifestParser.Parse(content); + + foreach (string provider in code.Keys) + { + generated.Add(provider, code[provider]); + } + + // Write the manifest text file + using (TextWriter wr = + new StreamWriter(Path.Combine(outputDirectory, Path.GetFileNameWithoutExtension(etlFile) + "_" + i.ToString() + ".man"))) + { + wr.Write(content); + } + } + } + else + { + Console.WriteLine("No manifest found in file:{0}", etlFile); + } + } + break; + case "/t:": string[] tmfs; string tmfDir = Path.GetDirectoryName(value); @@ -194,4 +240,4 @@ Examples: } } } -} \ No newline at end of file +} diff --git a/Source/Tx.LinqPad/ConnectionDialog.xaml.cs b/Source/Tx.LinqPad/ConnectionDialog.xaml.cs index 6e13a11..770bf72 100644 --- a/Source/Tx.LinqPad/ConnectionDialog.xaml.cs +++ b/Source/Tx.LinqPad/ConnectionDialog.xaml.cs @@ -150,7 +150,7 @@ namespace Tx.LinqPad { Title = "Add metadata files", Multiselect = true, - Filter = "All Files|*.man|Manifests|*.man;" + Filter = "Etl Files (*.etl)|*.etl|Manifests|*.man|All Files|*.*" }; if (fileDialog.ShowDialog().GetValueOrDefault()) {