1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
//go:build windows
// +build windows
package main
import (
"flag"
"fmt"
"os"
"github.com/Microsoft/go-winio/pkg/etw"
)
func main() {
var pn = flag.String("provider-name", "", "The human readable ETW provider name to be converted into GUID format")
flag.Parse()
if pn == nil || *pn == "" {
fmt.Fprint(os.Stderr, "--provider-name is required")
os.Exit(1)
}
p, err := etw.NewProvider(*pn, nil)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to convert provider-name: '%s' with err: '%s", *pn, err)
os.Exit(1)
}
defer p.Close()
fmt.Fprintf(os.Stdout, "%s", p)
}
|