• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15select
16    group_concat(thread.id,",") as threadId,
17    group_concat(thread.name,",") as threadName,
18    group_concat(process.id,",") as processId,
19    group_concat(process.name,",") as processName,
20    group_concat(callstack.name,",") as funName,
21    group_concat(callstack.dur,",") as dur,
22    group_concat(callstack.ts,",") as ts,
23    cast(callstack.chainId as varchar) as chainId,
24    callstack.spanId,
25    callstack.parentSpanId,
26    group_concat(callstack.flag,",") as flag,
27    (select value from meta where name="source_name") as trace_name
28from callstack
29inner join thread on callstack.callid = thread.id
30inner join process on process.id = thread.ipid
31where (callstack.flag="S" or callstack.flag="C")
32group by callstack.chainId,callstack.spanId,callstack.parentSpanId