fxt-tool.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. /*
  2. * StarPU
  3. * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #include "fxt-tool.h"
  17. char *worker_name[MAXWORKERS];
  18. static char *cpus_worker_colors[MAXWORKERS] = {"/greens9/7", "/greens9/6", "/greens9/5", "/greens9/4", "/greens9/9", "/greens9/3", "/greens9/2", "/greens9/1" };
  19. static char *cuda_worker_colors[MAXWORKERS] = {"/ylorrd9/9", "/ylorrd9/6", "/ylorrd9/3", "/ylorrd9/1", "/ylorrd9/8", "/ylorrd9/7", "/ylorrd9/4", "/ylorrd9/2", "/ylorrd9/1"};
  20. static char *other_worker_colors[MAXWORKERS] = {"/greys9/9", "/greys9/8", "/greys9/7", "/greys9/6"};
  21. static char *worker_colors[MAXWORKERS];
  22. static fxt_t fut;
  23. struct fxt_ev_64 ev;
  24. unsigned first_event = 1;
  25. uint64_t start_time = 0;
  26. uint64_t end_time = 0;
  27. unsigned nworkers = 0;
  28. char *filename = NULL;
  29. unsigned per_task_colour = 0;
  30. unsigned no_counter = 0;
  31. unsigned no_bus = 0;
  32. LIST_TYPE(symbol_name,
  33. char *name;
  34. );
  35. symbol_name_list_t symbol_list;
  36. /*
  37. * Paje trace file tools
  38. */
  39. static char *out_paje_path = "paje.trace";
  40. static FILE *out_paje_file;
  41. void paje_output_file_init(void)
  42. {
  43. /* create a new file */
  44. out_paje_file = fopen(out_paje_path, "w+");
  45. write_paje_header(out_paje_file);
  46. fprintf(out_paje_file, " \n \
  47. 1 P 0 \"Program\" \n \
  48. 1 Mn P \"Memory Node\" \n \
  49. 1 T Mn \"Worker\" \n \
  50. 1 Sc P \"Scheduler State\" \n \
  51. 2 event T \"event type\" \n \
  52. 3 S T \"Thread State\" \n \
  53. 3 MS Mn \"Memory Node State\" \n \
  54. 4 ntask Sc \"Number of tasks\" \n \
  55. 6 I S Initializing \"0.0 .7 1.0\" \n \
  56. 6 D S Deinitializing \"0.0 .1 .7\" \n \
  57. 6 Fi S FetchingInput \"1.0 .1 1.0\" \n \
  58. 6 Po S PushingOutput \"0.1 1.0 1.0\" \n \
  59. 6 E S Executing \".0 .6 .4\" \n \
  60. 6 C S Callback \".0 .3 .8\" \n \
  61. 6 B S Blocked \".9 .1 .0\" \n \
  62. 6 P S Progressing \".4 .1 .6\" \n \
  63. 6 A MS Allocating \".4 .1 .0\" \n \
  64. 6 Ar MS AllocatingReuse \".1 .1 .8\" \n \
  65. 6 R MS Reclaiming \".0 .1 .4\" \n \
  66. 6 Co MS DriverCopy \".3 .5 .1\" \n \
  67. 6 No MS Nothing \".0 .0 .0\" \n \
  68. 5 L P Mn Mn L\n");
  69. }
  70. void paje_output_file_terminate(void)
  71. {
  72. /* close the file */
  73. fclose(out_paje_file);
  74. }
  75. /*
  76. * Generic tools
  77. */
  78. void handle_new_mem_node(void)
  79. {
  80. char *memnodestr = malloc(16*sizeof(char));
  81. sprintf(memnodestr, "%ld", ev.param[0]);
  82. fprintf(out_paje_file, "7 %f %s Mn p MEMNODE%s\n", (float)((ev.time-start_time)/1000000.0), memnodestr, memnodestr);
  83. }
  84. static unsigned cuda_index = 0;
  85. static unsigned cpus_index = 0;
  86. static unsigned other_index = 0;
  87. void handle_worker_init_start(void)
  88. {
  89. /*
  90. arg0 : type of worker (cuda, core ..)
  91. arg1 : memory node
  92. arg2 : thread id
  93. */
  94. char *str = malloc(20*sizeof(char));
  95. char *color = NULL;
  96. strcpy(str, "unknown");
  97. switch (ev.param[0]) {
  98. case FUT_APPS_KEY:
  99. str = "apps";
  100. color = other_worker_colors[other_index++];
  101. break;
  102. case FUT_CORE_KEY:
  103. str = "core";
  104. color = cpus_worker_colors[cpus_index++];
  105. break;
  106. case FUT_CUDA_KEY:
  107. str = "cuda";
  108. color = cuda_worker_colors[cuda_index++];
  109. break;
  110. }
  111. // fprintf(stderr, "new %s worker (tid = %d)\n", str, ev.param[1]);
  112. char *memnodestr = malloc(16*sizeof(char));
  113. sprintf(memnodestr, "%ld", ev.param[1]);
  114. char *tidstr = malloc(16*sizeof(char));
  115. sprintf(tidstr, "%ld", ev.param[2]);
  116. fprintf(out_paje_file, "7 %f %s T MEMNODE%s %s \n", (float)((ev.time-start_time)/1000000.0), tidstr, memnodestr, tidstr);
  117. /* create a new key in the htable */
  118. uint64_t workerid = nworkers++;
  119. ENTRY item;
  120. item.key = tidstr;
  121. item.data = (void *)workerid;
  122. worker_colors[workerid] = color;
  123. ENTRY *res;
  124. res = hsearch(item, FIND);
  125. worker_name[workerid] = str;
  126. /* only register a thread once */
  127. STARPU_ASSERT(res == NULL);
  128. res = hsearch(item, ENTER);
  129. STARPU_ASSERT(res);
  130. /* start initialization */
  131. fprintf(out_paje_file, "10 %f S %ld I\n", (float)((ev.time-start_time)/1000000.0), ev.param[2]);
  132. }
  133. void handle_worker_init_end(void)
  134. {
  135. fprintf(out_paje_file, "10 %f S %ld B\n", (float)((ev.time-start_time)/1000000.0), ev.param[0]);
  136. }
  137. void handle_worker_deinit_start(void)
  138. {
  139. fprintf(out_paje_file, "10 %f S %ld D\n", (float)((ev.time-start_time)/1000000.0), ev.param[0]);
  140. }
  141. void handle_worker_deinit_end(void)
  142. {
  143. fprintf(out_paje_file, "8 %f %ld T\n", (float)((ev.time-start_time)/1000000.0), ev.param[1]);
  144. }
  145. int find_workder_id(unsigned long tid)
  146. {
  147. char tidstr[16];
  148. sprintf(tidstr, "%ld", tid);
  149. ENTRY item;
  150. item.key = tidstr;
  151. item.data = NULL;
  152. ENTRY *res;
  153. res = hsearch(item, FIND);
  154. //STARPU_ASSERT(res);
  155. if (!res)
  156. return -1;
  157. int id = (uintptr_t)(res->data);
  158. return id;
  159. }
  160. static unsigned get_colour_symbol_red(char *name)
  161. {
  162. /* choose some colour ... that's disguting yes */
  163. uint32_t hash_symbol = crc32_string(name, 0);
  164. return (unsigned)crc32_string("red", hash_symbol) % 1024;
  165. }
  166. static unsigned get_colour_symbol_green(char *name)
  167. {
  168. /* choose some colour ... that's disguting yes */
  169. uint32_t hash_symbol = crc32_string(name, 0);
  170. return (unsigned)crc32_string("green", hash_symbol) % 1024;
  171. }
  172. static unsigned get_colour_symbol_blue(char *name)
  173. {
  174. /* choose some colour ... that's disguting yes */
  175. uint32_t hash_symbol = crc32_string(name, 0);
  176. return (unsigned)crc32_string("blue", hash_symbol) % 1024;
  177. }
  178. static void create_paje_state_if_not_found(char *name)
  179. {
  180. symbol_name_itor_t itor;
  181. for (itor = symbol_name_list_begin(symbol_list);
  182. itor != symbol_name_list_end(symbol_list);
  183. itor = symbol_name_list_next(itor))
  184. {
  185. if (!strcmp(name, itor->name))
  186. {
  187. /* we found an entry */
  188. return;
  189. }
  190. }
  191. /* it's the first time ... */
  192. symbol_name_t entry = symbol_name_new();
  193. entry->name = malloc(strlen(name));
  194. strcpy(entry->name, name);
  195. symbol_name_list_push_front(symbol_list, entry);
  196. /* choose some colour ... that's disguting yes */
  197. unsigned hash_symbol_red = get_colour_symbol_red(name);
  198. unsigned hash_symbol_green = get_colour_symbol_green(name);
  199. unsigned hash_symbol_blue = get_colour_symbol_blue(name);
  200. fprintf(stderr, "name %s hash red %d green %d blue %d \n", name, hash_symbol_red, hash_symbol_green, hash_symbol_blue);
  201. uint32_t hash_sum = hash_symbol_red + hash_symbol_green + hash_symbol_blue;
  202. float red = (1.0f * hash_symbol_red) / hash_sum;
  203. float green = (1.0f * hash_symbol_green) / hash_sum;
  204. float blue = (1.0f * hash_symbol_blue) / hash_sum;
  205. /* create the Paje state */
  206. fprintf(out_paje_file, "6 %s S %s \"%f %f %f\" \n", name, red, green, blue, name);
  207. }
  208. void handle_start_codelet_body(void)
  209. {
  210. int worker;
  211. worker = find_workder_id(ev.param[1]);
  212. if (worker < 0) return;
  213. if (per_task_colour)
  214. {
  215. unsigned long has_name = ev.param[2];
  216. char *name = has_name?(char *)&ev.param[3]:"unknown";
  217. create_paje_state_if_not_found(name);
  218. fprintf(out_paje_file, "101 %f S %ld E %s\n", (float)((ev.time-start_time)/1000000.0), ev.param[1], name);
  219. }
  220. else {
  221. fprintf(out_paje_file, "10 %f S %ld E\n", (float)((ev.time-start_time)/1000000.0), ev.param[1]);
  222. }
  223. end_time = STARPU_MAX(end_time, ev.time);
  224. }
  225. void handle_end_codelet_body(void)
  226. {
  227. //fprintf(stderr, "end codelet %p on tid %d\n", (void *)ev.param[0], ev.param[1]);
  228. int worker;
  229. worker = find_workder_id(ev.param[1]);
  230. if (worker < 0) return;
  231. // printf("<- worker %d\n", worker);
  232. fprintf(out_paje_file, "10 %f S %ld B\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  233. end_time = STARPU_MAX(end_time, ev.time);
  234. }
  235. void handle_user_event(void)
  236. {
  237. int worker;
  238. worker = find_workder_id(ev.param[1]);
  239. if (worker < 0) return;
  240. unsigned code;
  241. code = ev.param[2];
  242. fprintf(out_paje_file, "9 %f event %ld %d\n", (float)((ev.time-start_time)/1000000.0), ev.param[1], code);
  243. }
  244. void handle_start_callback(void)
  245. {
  246. int worker;
  247. worker = find_workder_id(ev.param[1]);
  248. if (worker < 0) return;
  249. fprintf(out_paje_file, "10 %f S %ld C\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  250. }
  251. void handle_end_callback(void)
  252. {
  253. int worker;
  254. worker = find_workder_id(ev.param[1]);
  255. if (worker < 0) return;
  256. fprintf(out_paje_file, "10 %f S %ld B\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  257. }
  258. void handle_start_fetch_input(void)
  259. {
  260. int worker;
  261. worker = find_workder_id(ev.param[1]);
  262. if (worker < 0) return;
  263. fprintf(out_paje_file, "10 %f S %ld Fi\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  264. end_time = STARPU_MAX(end_time, ev.time);
  265. }
  266. void handle_end_fetch_input(void)
  267. {
  268. int worker;
  269. worker = find_workder_id(ev.param[1]);
  270. if (worker < 0) return;
  271. fprintf(out_paje_file, "10 %f S %ld B\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  272. end_time = STARPU_MAX(end_time, ev.time);
  273. }
  274. void handle_start_push_output(void)
  275. {
  276. int worker;
  277. worker = find_workder_id(ev.param[1]);
  278. if (worker < 0) return;
  279. fprintf(out_paje_file, "10 %f S %ld Po\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  280. end_time = STARPU_MAX(end_time, ev.time);
  281. }
  282. void handle_end_push_output(void)
  283. {
  284. int worker;
  285. worker = find_workder_id(ev.param[1]);
  286. if (worker < 0) return;
  287. fprintf(out_paje_file, "10 %f S %ld B\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  288. end_time = STARPU_MAX(end_time, ev.time);
  289. }
  290. void handle_start_progress(void)
  291. {
  292. int worker;
  293. worker = find_workder_id(ev.param[1]);
  294. if (worker < 0) return;
  295. fprintf(out_paje_file, "10 %f S %ld P\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  296. end_time = STARPU_MAX(end_time, ev.time);
  297. }
  298. void handle_end_progress(void)
  299. {
  300. int worker;
  301. worker = find_workder_id(ev.param[1]);
  302. if (worker < 0) return;
  303. fprintf(out_paje_file, "10 %f S %ld B\n", (float)((ev.time-start_time)/1000000.0), ev.param[1] );
  304. end_time = STARPU_MAX(end_time, ev.time);
  305. }
  306. void handle_data_copy(void)
  307. {
  308. }
  309. void handle_start_driver_copy(void)
  310. {
  311. unsigned src = ev.param[0];
  312. unsigned dst = ev.param[1];
  313. unsigned size = ev.param[2];
  314. unsigned comid = ev.param[3];
  315. if (!no_bus)
  316. fprintf(out_paje_file, "10 %f MS MEMNODE%d Co\n", (float)((ev.time-start_time)/1000000.0), dst);
  317. if (!no_bus)
  318. fprintf(out_paje_file, "18 %f L p %d MEMNODE%d com_%d\n", (float)((ev.time-start_time)/1000000.0), size, src, comid);
  319. }
  320. void handle_end_driver_copy(void)
  321. {
  322. unsigned dst = ev.param[1];
  323. unsigned size = ev.param[2];
  324. unsigned comid = ev.param[3];
  325. fprintf(out_paje_file, "10 %f MS MEMNODE%d No\n", (float)((ev.time-start_time)/1000000.0), dst);
  326. fprintf(out_paje_file, "19 %f L p %d MEMNODE%d com_%d\n", (float)((ev.time-start_time)/1000000.0), size, dst, comid);
  327. }
  328. void handle_start_alloc(void)
  329. {
  330. unsigned memnode = ev.param[0];
  331. fprintf(out_paje_file, "10 %f MS MEMNODE%d A\n", (float)((ev.time-start_time)/1000000.0), memnode);
  332. }
  333. void handle_end_alloc(void)
  334. {
  335. unsigned memnode = ev.param[0];
  336. fprintf(out_paje_file, "10 %f MS MEMNODE%d No\n", (float)((ev.time-start_time)/1000000.0), memnode);
  337. }
  338. void handle_start_alloc_reuse(void)
  339. {
  340. unsigned memnode = ev.param[0];
  341. fprintf(out_paje_file, "10 %f MS MEMNODE%d Ar\n", (float)((ev.time-start_time)/1000000.0), memnode);
  342. }
  343. void handle_end_alloc_reuse(void)
  344. {
  345. unsigned memnode = ev.param[0];
  346. fprintf(out_paje_file, "10 %f MS MEMNODE%d No\n", (float)((ev.time-start_time)/1000000.0), memnode);
  347. }
  348. void handle_start_memreclaim(void)
  349. {
  350. unsigned memnode = ev.param[0];
  351. fprintf(out_paje_file, "10 %f MS MEMNODE%d R\n", (float)((ev.time-start_time)/1000000.0), memnode);
  352. }
  353. void handle_end_memreclaim(void)
  354. {
  355. unsigned memnode = ev.param[0];
  356. fprintf(out_paje_file, "10 %f MS MEMNODE%d No\n", (float)((ev.time-start_time)/1000000.0), memnode);
  357. }
  358. int curq_size = 0;
  359. void handle_job_push(void)
  360. {
  361. curq_size++;
  362. fprintf(out_paje_file, "13 %f ntask sched %f\n", (float)((ev.time-start_time)/1000000.0), (float)curq_size);
  363. }
  364. void handle_job_pop(void)
  365. {
  366. curq_size--;
  367. fprintf(out_paje_file, "13 %f ntask sched %f\n", (float)((ev.time-start_time)/1000000.0), (float)curq_size);
  368. }
  369. void handle_codelet_tag_deps(void)
  370. {
  371. uint64_t child;
  372. uint64_t father;
  373. child = ev.param[0];
  374. father = ev.param[1];
  375. add_deps(child, father);
  376. }
  377. void handle_task_done(void)
  378. {
  379. uint64_t tag_id;
  380. tag_id = ev.param[0];
  381. unsigned long has_name = ev.param[2];
  382. char *name = has_name?(char *)&ev.param[3]:"unknown";
  383. int worker;
  384. worker = find_workder_id(ev.param[1]);
  385. char *colour;
  386. char buffer[32];
  387. if (per_task_colour) {
  388. snprintf(buffer, 32, "%.4f,%.4f,%.4f",
  389. get_colour_symbol_red(name)/1024.0,
  390. get_colour_symbol_green(name)/1024.0,
  391. get_colour_symbol_blue(name)/1024.0);
  392. colour = &buffer[0];
  393. }
  394. else {
  395. colour=(worker < 0)?"0.0,0.0,0.0":worker_colors[worker];
  396. }
  397. dot_set_tag_done(tag_id, colour);
  398. }
  399. static void parse_args(int argc, char **argv)
  400. {
  401. int i;
  402. for (i = 1; i < argc; i++) {
  403. if (strcmp(argv[i], "-c") == 0) {
  404. per_task_colour = 1;
  405. }
  406. if (strcmp(argv[i], "-o") == 0) {
  407. out_paje_path = argv[++i];
  408. }
  409. if (strcmp(argv[i], "-i") == 0) {
  410. filename = argv[++i];
  411. }
  412. if (strcmp(argv[i], "-no-counter") == 0) {
  413. no_counter = 1;
  414. }
  415. if (strcmp(argv[i], "-no-bus") == 0) {
  416. no_bus = 1;
  417. }
  418. if (strcmp(argv[i], "-h") == 0) {
  419. fprintf(stderr, "Usage : %s [-c] [-no-counter] [-no-bus] [-i input_filename] [-o output_filename]\n", argv[0]);
  420. fprintf(stderr, "\t-c: use a different colour for every type of task.\n");
  421. exit(-1);
  422. }
  423. }
  424. }
  425. /*
  426. * This program should be used to parse the log generated by FxT
  427. */
  428. int main(int argc, char **argv)
  429. {
  430. int ret;
  431. int fd_in, fd_out;
  432. int use_stdout = 1;
  433. init_dag_dot();
  434. parse_args(argc, argv);
  435. fd_in = open(filename, O_RDONLY);
  436. if (fd_in < 0) {
  437. perror("open failed :");
  438. exit(-1);
  439. }
  440. fut = fxt_fdopen(fd_in);
  441. if (!fut) {
  442. perror("fxt_fdopen :");
  443. exit(-1);
  444. }
  445. fxt_blockev_t block;
  446. block = fxt_blockev_enter(fut);
  447. /* create a htable to identify each worker(tid) */
  448. hcreate(MAXWORKERS);
  449. symbol_list = symbol_name_list_new();
  450. paje_output_file_init();
  451. while(1) {
  452. ret = fxt_next_ev(block, FXT_EV_TYPE_64, (struct fxt_ev *)&ev);
  453. if (ret != FXT_EV_OK) {
  454. fprintf(stderr, "no more block ...\n");
  455. break;
  456. }
  457. __attribute__ ((unused)) int nbparam = ev.nb_params;
  458. if (first_event)
  459. {
  460. first_event = 0;
  461. start_time = ev.time;
  462. /* create the "program" container */
  463. fprintf(out_paje_file, "7 %f p P 0 program \n", (float)(start_time-start_time));
  464. /* create a variable with the number of tasks */
  465. if (!no_counter)
  466. {
  467. fprintf(out_paje_file, "7 %f sched Sc p scheduler \n", (float)(start_time-start_time));
  468. fprintf(out_paje_file, "13 %f ntask sched 0.0\n", (float)(start_time-start_time));
  469. }
  470. }
  471. switch (ev.code) {
  472. case FUT_WORKER_INIT_START:
  473. handle_worker_init_start();
  474. break;
  475. case FUT_WORKER_INIT_END:
  476. handle_worker_init_end();
  477. break;
  478. case FUT_NEW_MEM_NODE:
  479. handle_new_mem_node();
  480. break;
  481. /* detect when the workers were idling or not */
  482. case FUT_START_CODELET_BODY:
  483. handle_start_codelet_body();
  484. break;
  485. case FUT_END_CODELET_BODY:
  486. handle_end_codelet_body();
  487. break;
  488. case FUT_START_CALLBACK:
  489. handle_start_callback();
  490. break;
  491. case FUT_END_CALLBACK:
  492. handle_end_callback();
  493. break;
  494. /* monitor stack size */
  495. case FUT_JOB_PUSH:
  496. if (!no_counter)
  497. handle_job_push();
  498. break;
  499. case FUT_JOB_POP:
  500. if (!no_counter)
  501. handle_job_pop();
  502. break;
  503. /* check the memory transfer overhead */
  504. case FUT_START_FETCH_INPUT:
  505. handle_start_fetch_input();
  506. break;
  507. case FUT_END_FETCH_INPUT:
  508. handle_end_fetch_input();
  509. break;
  510. case FUT_START_PUSH_OUTPUT:
  511. handle_start_push_output();
  512. break;
  513. case FUT_END_PUSH_OUTPUT:
  514. handle_end_push_output();
  515. break;
  516. case FUT_START_PROGRESS:
  517. handle_start_progress();
  518. break;
  519. case FUT_END_PROGRESS:
  520. handle_end_progress();
  521. break;
  522. case FUT_CODELET_TAG:
  523. //handle_codelet_tag();
  524. break;
  525. case FUT_CODELET_TAG_DEPS:
  526. handle_codelet_tag_deps();
  527. break;
  528. case FUT_TASK_DONE:
  529. handle_task_done();
  530. break;
  531. case FUT_DATA_COPY:
  532. if (!no_bus)
  533. handle_data_copy();
  534. break;
  535. case FUT_START_DRIVER_COPY:
  536. if (!no_bus)
  537. handle_start_driver_copy();
  538. break;
  539. case FUT_END_DRIVER_COPY:
  540. if (!no_bus)
  541. handle_end_driver_copy();
  542. break;
  543. case FUT_WORK_STEALING:
  544. /* XXX */
  545. break;
  546. case FUT_WORKER_DEINIT_START:
  547. handle_worker_deinit_start();
  548. break;
  549. case FUT_WORKER_DEINIT_END:
  550. handle_worker_deinit_end();
  551. break;
  552. case FUT_START_ALLOC:
  553. if (!no_bus)
  554. handle_start_alloc();
  555. break;
  556. case FUT_END_ALLOC:
  557. if (!no_bus)
  558. handle_end_alloc();
  559. break;
  560. case FUT_START_ALLOC_REUSE:
  561. if (!no_bus)
  562. handle_start_alloc_reuse();
  563. break;
  564. case FUT_END_ALLOC_REUSE:
  565. if (!no_bus)
  566. handle_end_alloc_reuse();
  567. break;
  568. case FUT_START_MEMRECLAIM:
  569. handle_start_memreclaim();
  570. break;
  571. case FUT_END_MEMRECLAIM:
  572. handle_end_memreclaim();
  573. break;
  574. case FUT_USER_EVENT:
  575. handle_user_event();
  576. break;
  577. default:
  578. fprintf(stderr, "unknown event.. %x at time %llx\n", (unsigned)ev.code, (long long unsigned)ev.time);
  579. break;
  580. }
  581. }
  582. paje_output_file_terminate();
  583. terminate_dat_dot();
  584. return 0;
  585. }