diff --git a/src/types/ebpf.d.ts b/src/types/ebpf.d.ts
index 36ed2082..53badf56 100644
--- a/src/types/ebpf.d.ts
+++ b/src/types/ebpf.d.ts
@@ -77,6 +77,21 @@ export type StackElement = {
rateOfRoot?: string;
rateOfParent: string;
};
+export type TraceProfilingElement = {
+ id: string;
+ originId: string;
+ name: string;
+ parentId: string;
+ codeSignature: string;
+ count: number;
+ stackType: string;
+ value: number;
+ children?: TraceProfilingElement[];
+ rateOfRoot?: string;
+ rateOfParent: string;
+ duration: number;
+ durationChildExcluded: number;
+};
export type AnalyzationTrees = {
id: string;
parentId: string;
diff --git a/src/utils/flameGraph.ts b/src/utils/flameGraph.ts
new file mode 100644
index 00000000..98e4d192
--- /dev/null
+++ b/src/utils/flameGraph.ts
@@ -0,0 +1,24 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export function treeForeach(tree: any, func: (node: any) => void) {
+ for (const data of tree) {
+ data.children && treeForeach(data.children, func);
+ func(data);
+ }
+ return tree;
+}
diff --git a/src/views/dashboard/related/ebpf/components/EBPFStack.vue b/src/views/dashboard/related/ebpf/components/EBPFStack.vue
index 988f2193..190d732d 100644
--- a/src/views/dashboard/related/ebpf/components/EBPFStack.vue
+++ b/src/views/dashboard/related/ebpf/components/EBPFStack.vue
@@ -28,6 +28,7 @@ limitations under the License. -->
import type { StackElement } from "@/types/ebpf";
import { AggregateTypes } from "./data";
import "d3-flame-graph/dist/d3-flamegraph.css";
+ import { treeForeach } from "@/utils/flameGraph";
/*global Nullable, defineProps*/
const props = defineProps({
@@ -180,14 +181,6 @@ limitations under the License. -->
return res;
}
- function treeForeach(tree: StackElement[], func: (node: StackElement) => void) {
- for (const data of tree) {
- data.children && treeForeach(data.children, func);
- func(data);
- }
- return tree;
- }
-
watch(
() => ebpfStore.analyzeTrees,
() => {
diff --git a/src/views/dashboard/related/profile/Content.vue b/src/views/dashboard/related/profile/Content.vue
index e6f3be83..2adcfc94 100644
--- a/src/views/dashboard/related/profile/Content.vue
+++ b/src/views/dashboard/related/profile/Content.vue
@@ -19,9 +19,11 @@ limitations under the License. -->