ses topo
authoryu.dongliang <18588496441@163.com>
Tue, 25 Jul 2023 15:16:44 +0000 (23:16 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 25 Jul 2023 15:16:44 +0000 (23:16 +0800)
ses_step_topo.c

index cc0e5fd55b2d69c93eccf4edecd09f2104d5f530..a26dfb3a455bb78061395aed83eba8d26298937a 100644 (file)
@@ -168,10 +168,33 @@ static int _topo_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t*
 
                scf_logw("i: %ld\n", i);
 
-               __dfs_path(f, c, p, ctx, &path);
+               int ret = __dfs_path(f, c, p, ctx, &path);
+               if (ret < 0)
+                       return ret;
 
-               printf("\n");
+               printf("ret: %d\n\n", ret);
+
+               if (!path)
+                       continue;
+
+               if (ret > 0) {
+                       scf_vector_clear(path, NULL);
+                       continue;
+               }
+
+               if (scf_vector_add(ctx->paths, path) < 0) {
+                       scf_vector_free(path);
+                       return -ENOMEM;
+               }
+
+               path = NULL;
        }
+
+       if (path) {
+               scf_vector_free(path);
+               path = NULL;
+       }
+
 #if 1
        for (i = 0; i < ctx->paths->size; i++) {
                path      = ctx->paths->data[i];