blob: cf553470a448d93bb166ae1a07ab7c0a21a6e7ba (
plain) (
blame)
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
29
30
31
32
33
34
35
36
37
38
39
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej
package prog
import (
"strings"
)
type Spec struct {
Program string
Args []string
BaseName string
Env map[string]string
numaSocket int
shouldUseCallgrind bool
shouldUseValgrind bool
shouldUseNumaCtl bool
shouldUseVespaMalloc bool
vespaMallocPreload string
}
func NewSpec(argv []string) *Spec {
progName := argv[0]
p := Spec{
Program: progName,
Args: argv,
BaseName: baseNameOf(progName),
Env: make(map[string]string),
numaSocket: -1,
}
return &p
}
func baseNameOf(s string) string {
idx := strings.LastIndex(s, "/")
idx++
return s[idx:]
}
|