aboutsummaryrefslogtreecommitdiffstats
path: root/func.go
diff options
context:
space:
mode:
authorFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-06-15 15:21:47 +0900
committerFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-06-15 15:21:47 +0900
commitf543f4db924daf39eb0e604636c7839175a35abd (patch)
tree2959721bfac098d902b9eecd1d2c101d2971b181 /func.go
parent4a708512624fe1bec939fd41661665c27bd0ebcb (diff)
downloadandroid_build_kati-f543f4db924daf39eb0e604636c7839175a35abd.tar.gz
android_build_kati-f543f4db924daf39eb0e604636c7839175a35abd.tar.bz2
android_build_kati-f543f4db924daf39eb0e604636c7839175a35abd.zip
trace event: also emit findcache init event
Diffstat (limited to 'func.go')
-rw-r--r--func.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/func.go b/func.go
index 3ac9404..5572236 100644
--- a/func.go
+++ b/func.go
@@ -447,7 +447,7 @@ func (f *funcWildcard) Eval(w io.Writer, ev *Evaluator) {
assertArity("wildcard", 1, len(f.args))
abuf := newBuf()
f.args[1].Eval(abuf, ev)
- te := traceEvent.begin("wildcard", tmpval(abuf.Bytes()))
+ te := traceEvent.begin("wildcard", string(abuf.Bytes()), traceEventMain)
if ev.avoidIO && !useWildcardCache {
ev.hasIO = true
w.Write([]byte("$(/bin/ls -d "))
@@ -721,7 +721,7 @@ func (f *funcShell) Eval(w io.Writer, ev *Evaluator) {
abuf := newBuf()
f.args[1].Eval(abuf, ev)
if ev.avoidIO && !hasNoIoInShellScript(abuf.Bytes()) {
- te := traceEvent.begin("shell", tmpval(abuf.Bytes()))
+ te := traceEvent.begin("shell", string(abuf.Bytes()), traceEventMain)
ev.hasIO = true
w.Write([]byte("$("))
w.Write(abuf.Bytes())
@@ -740,7 +740,7 @@ func (f *funcShell) Eval(w io.Writer, ev *Evaluator) {
Args: cmdline,
Stderr: os.Stderr,
}
- te := traceEvent.begin("shell", literal(arg))
+ te := traceEvent.begin("shell", arg, traceEventMain)
out, err := cmd.Output()
shellFuncTime += time.Since(te.t)
shellFuncCount++
@@ -784,14 +784,15 @@ func (f *funcCall) Arity() int { return 0 }
func (f *funcCall) Eval(w io.Writer, ev *Evaluator) {
abuf := newBuf()
fargs := ev.args(abuf, f.args[1:]...)
- variable := fargs[0]
- te := traceEvent.begin("call", tmpval(variable))
+ varname := fargs[0]
+ variable := string(varname)
+ te := traceEvent.begin("call", variable, traceEventMain)
Logf("call %q variable %q", f.args[1], variable)
- v := ev.LookupVar(string(variable))
+ v := ev.LookupVar(variable)
// Evalualte all arguments first before we modify the table.
var args []tmpval
// $0 is variable.
- args = append(args, tmpval(variable))
+ args = append(args, tmpval(varname))
// TODO(ukai): If variable is the name of a built-in function,
// the built-in function is always invoked (even if a make variable
// by that name also exists).