MCPcopy Create free account
hub / github.com/google/gapid / Query

Method Query

gapis/perfetto/processor.go:46–60  ·  view source on GitHub ↗
(q string)

Source from the content-addressed store, hash-verified

44}
45
46func (p *Processor) Query(q string) (*service.QueryResult, error) {
47 p.mutex.Lock()
48 defer p.mutex.Unlock()
49
50 r := &service.QueryResult{}
51
52 qPtr := C.CString(q)
53 res := C.execute_query(p.handle, qPtr)
54 // Convert the cgo memory pointer to a go slice and parse the proto.
55 err := proto.Unmarshal((*[1 << 31]byte)(unsafe.Pointer(res.data))[:int(res.size)], r)
56 C.free(unsafe.Pointer(res.data))
57 C.free(unsafe.Pointer(qPtr))
58
59 return r, err
60}
61
62func (p *Processor) Close() {
63 C.delete_processor(p.handle)

Callers 15

RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45

Calls 5

LockMethod · 0.80
UnlockMethod · 0.80
UnmarshalMethod · 0.80
freeMethod · 0.65
PointerMethod · 0.45

Tested by

no test coverage detected