newt.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. #define _GNU_SOURCE
  2. #include <stdio.h>
  3. #undef _GNU_SOURCE
  4. #include <stdlib.h>
  5. #include <newt.h>
  6. #include <sys/ttydefaults.h>
  7. #include "cache.h"
  8. #include "hist.h"
  9. #include "session.h"
  10. #include "sort.h"
  11. #include "symbol.h"
  12. struct ui_progress {
  13. newtComponent form, scale;
  14. };
  15. struct ui_progress *ui_progress__new(const char *title, u64 total)
  16. {
  17. struct ui_progress *self = malloc(sizeof(*self));
  18. if (self != NULL) {
  19. int cols;
  20. newtGetScreenSize(&cols, NULL);
  21. cols -= 4;
  22. newtCenteredWindow(cols, 1, title);
  23. self->form = newtForm(NULL, NULL, 0);
  24. if (self->form == NULL)
  25. goto out_free_self;
  26. self->scale = newtScale(0, 0, cols, total);
  27. if (self->scale == NULL)
  28. goto out_free_form;
  29. newtFormAddComponent(self->form, self->scale);
  30. newtRefresh();
  31. }
  32. return self;
  33. out_free_form:
  34. newtFormDestroy(self->form);
  35. out_free_self:
  36. free(self);
  37. return NULL;
  38. }
  39. void ui_progress__update(struct ui_progress *self, u64 curr)
  40. {
  41. newtScaleSet(self->scale, curr);
  42. newtRefresh();
  43. }
  44. void ui_progress__delete(struct ui_progress *self)
  45. {
  46. newtFormDestroy(self->form);
  47. newtPopWindow();
  48. free(self);
  49. }
  50. static void ui_helpline__pop(void)
  51. {
  52. newtPopHelpLine();
  53. }
  54. static void ui_helpline__push(const char *msg)
  55. {
  56. newtPushHelpLine(msg);
  57. }
  58. static void ui_helpline__vpush(const char *fmt, va_list ap)
  59. {
  60. char *s;
  61. if (vasprintf(&s, fmt, ap) < 0)
  62. vfprintf(stderr, fmt, ap);
  63. else {
  64. ui_helpline__push(s);
  65. free(s);
  66. }
  67. }
  68. static void ui_helpline__fpush(const char *fmt, ...)
  69. {
  70. va_list ap;
  71. va_start(ap, fmt);
  72. ui_helpline__vpush(fmt, ap);
  73. va_end(ap);
  74. }
  75. static void ui_helpline__puts(const char *msg)
  76. {
  77. ui_helpline__pop();
  78. ui_helpline__push(msg);
  79. }
  80. static char browser__last_msg[1024];
  81. int browser__show_help(const char *format, va_list ap)
  82. {
  83. int ret;
  84. static int backlog;
  85. ret = vsnprintf(browser__last_msg + backlog,
  86. sizeof(browser__last_msg) - backlog, format, ap);
  87. backlog += ret;
  88. if (browser__last_msg[backlog - 1] == '\n') {
  89. ui_helpline__puts(browser__last_msg);
  90. newtRefresh();
  91. backlog = 0;
  92. }
  93. return ret;
  94. }
  95. static void newt_form__set_exit_keys(newtComponent self)
  96. {
  97. newtFormAddHotKey(self, NEWT_KEY_ESCAPE);
  98. newtFormAddHotKey(self, 'Q');
  99. newtFormAddHotKey(self, 'q');
  100. newtFormAddHotKey(self, CTRL('c'));
  101. }
  102. static newtComponent newt_form__new(void)
  103. {
  104. newtComponent self = newtForm(NULL, NULL, 0);
  105. if (self)
  106. newt_form__set_exit_keys(self);
  107. return self;
  108. }
  109. static int popup_menu(int argc, char * const argv[])
  110. {
  111. struct newtExitStruct es;
  112. int i, rc = -1, max_len = 5;
  113. newtComponent listbox, form = newt_form__new();
  114. if (form == NULL)
  115. return -1;
  116. listbox = newtListbox(0, 0, argc, NEWT_FLAG_RETURNEXIT);
  117. if (listbox == NULL)
  118. goto out_destroy_form;
  119. newtFormAddComponent(form, listbox);
  120. for (i = 0; i < argc; ++i) {
  121. int len = strlen(argv[i]);
  122. if (len > max_len)
  123. max_len = len;
  124. if (newtListboxAddEntry(listbox, argv[i], (void *)(long)i))
  125. goto out_destroy_form;
  126. }
  127. newtCenteredWindow(max_len, argc, NULL);
  128. newtFormRun(form, &es);
  129. rc = newtListboxGetCurrent(listbox) - NULL;
  130. if (es.reason == NEWT_EXIT_HOTKEY)
  131. rc = -1;
  132. newtPopWindow();
  133. out_destroy_form:
  134. newtFormDestroy(form);
  135. return rc;
  136. }
  137. static bool dialog_yesno(const char *msg)
  138. {
  139. /* newtWinChoice should really be accepting const char pointers... */
  140. char yes[] = "Yes", no[] = "No";
  141. return newtWinChoice(NULL, yes, no, (char *)msg) == 1;
  142. }
  143. /*
  144. * When debugging newt problems it was useful to be able to "unroll"
  145. * the calls to newtCheckBoxTreeAdd{Array,Item}, so that we can generate
  146. * a source file with the sequence of calls to these methods, to then
  147. * tweak the arrays to get the intended results, so I'm keeping this code
  148. * here, may be useful again in the future.
  149. */
  150. #undef NEWT_DEBUG
  151. static void newt_checkbox_tree__add(newtComponent tree, const char *str,
  152. void *priv, int *indexes)
  153. {
  154. #ifdef NEWT_DEBUG
  155. /* Print the newtCheckboxTreeAddArray to tinker with its index arrays */
  156. int i = 0, len = 40 - strlen(str);
  157. fprintf(stderr,
  158. "\tnewtCheckboxTreeAddItem(tree, %*.*s\"%s\", (void *)%p, 0, ",
  159. len, len, " ", str, priv);
  160. while (indexes[i] != NEWT_ARG_LAST) {
  161. if (indexes[i] != NEWT_ARG_APPEND)
  162. fprintf(stderr, " %d,", indexes[i]);
  163. else
  164. fprintf(stderr, " %s,", "NEWT_ARG_APPEND");
  165. ++i;
  166. }
  167. fprintf(stderr, " %s", " NEWT_ARG_LAST);\n");
  168. fflush(stderr);
  169. #endif
  170. newtCheckboxTreeAddArray(tree, str, priv, 0, indexes);
  171. }
  172. static char *callchain_list__sym_name(struct callchain_list *self,
  173. char *bf, size_t bfsize)
  174. {
  175. if (self->ms.sym)
  176. return self->ms.sym->name;
  177. snprintf(bf, bfsize, "%#Lx", self->ip);
  178. return bf;
  179. }
  180. static void __callchain__append_graph_browser(struct callchain_node *self,
  181. newtComponent tree, u64 total,
  182. int *indexes, int depth)
  183. {
  184. struct rb_node *node;
  185. u64 new_total, remaining;
  186. int idx = 0;
  187. if (callchain_param.mode == CHAIN_GRAPH_REL)
  188. new_total = self->children_hit;
  189. else
  190. new_total = total;
  191. remaining = new_total;
  192. node = rb_first(&self->rb_root);
  193. while (node) {
  194. struct callchain_node *child = rb_entry(node, struct callchain_node, rb_node);
  195. struct rb_node *next = rb_next(node);
  196. u64 cumul = cumul_hits(child);
  197. struct callchain_list *chain;
  198. int first = true, printed = 0;
  199. int chain_idx = -1;
  200. remaining -= cumul;
  201. indexes[depth] = NEWT_ARG_APPEND;
  202. indexes[depth + 1] = NEWT_ARG_LAST;
  203. list_for_each_entry(chain, &child->val, list) {
  204. char ipstr[BITS_PER_LONG / 4 + 1],
  205. *alloc_str = NULL;
  206. const char *str = callchain_list__sym_name(chain, ipstr, sizeof(ipstr));
  207. if (first) {
  208. double percent = cumul * 100.0 / new_total;
  209. first = false;
  210. if (asprintf(&alloc_str, "%2.2f%% %s", percent, str) < 0)
  211. str = "Not enough memory!";
  212. else
  213. str = alloc_str;
  214. } else {
  215. indexes[depth] = idx;
  216. indexes[depth + 1] = NEWT_ARG_APPEND;
  217. indexes[depth + 2] = NEWT_ARG_LAST;
  218. ++chain_idx;
  219. }
  220. newt_checkbox_tree__add(tree, str, &chain->ms, indexes);
  221. free(alloc_str);
  222. ++printed;
  223. }
  224. indexes[depth] = idx;
  225. if (chain_idx != -1)
  226. indexes[depth + 1] = chain_idx;
  227. if (printed != 0)
  228. ++idx;
  229. __callchain__append_graph_browser(child, tree, new_total, indexes,
  230. depth + (chain_idx != -1 ? 2 : 1));
  231. node = next;
  232. }
  233. }
  234. static void callchain__append_graph_browser(struct callchain_node *self,
  235. newtComponent tree, u64 total,
  236. int *indexes, int parent_idx)
  237. {
  238. struct callchain_list *chain;
  239. int i = 0;
  240. indexes[1] = NEWT_ARG_APPEND;
  241. indexes[2] = NEWT_ARG_LAST;
  242. list_for_each_entry(chain, &self->val, list) {
  243. char ipstr[BITS_PER_LONG / 4 + 1], *str;
  244. if (chain->ip >= PERF_CONTEXT_MAX)
  245. continue;
  246. if (!i++ && sort__first_dimension == SORT_SYM)
  247. continue;
  248. str = callchain_list__sym_name(chain, ipstr, sizeof(ipstr));
  249. newt_checkbox_tree__add(tree, str, &chain->ms, indexes);
  250. }
  251. indexes[1] = parent_idx;
  252. indexes[2] = NEWT_ARG_APPEND;
  253. indexes[3] = NEWT_ARG_LAST;
  254. __callchain__append_graph_browser(self, tree, total, indexes, 2);
  255. }
  256. static void hist_entry__append_callchain_browser(struct hist_entry *self,
  257. newtComponent tree, u64 total, int parent_idx)
  258. {
  259. struct rb_node *rb_node;
  260. int indexes[1024] = { [0] = parent_idx, };
  261. int idx = 0;
  262. struct callchain_node *chain;
  263. rb_node = rb_first(&self->sorted_chain);
  264. while (rb_node) {
  265. chain = rb_entry(rb_node, struct callchain_node, rb_node);
  266. switch (callchain_param.mode) {
  267. case CHAIN_FLAT:
  268. break;
  269. case CHAIN_GRAPH_ABS: /* falldown */
  270. case CHAIN_GRAPH_REL:
  271. callchain__append_graph_browser(chain, tree, total, indexes, idx++);
  272. break;
  273. case CHAIN_NONE:
  274. default:
  275. break;
  276. }
  277. rb_node = rb_next(rb_node);
  278. }
  279. }
  280. static size_t hist_entry__append_browser(struct hist_entry *self,
  281. newtComponent tree, u64 total)
  282. {
  283. char s[256];
  284. size_t ret;
  285. if (symbol_conf.exclude_other && !self->parent)
  286. return 0;
  287. ret = hist_entry__snprintf(self, s, sizeof(s), NULL,
  288. false, 0, false, total);
  289. if (symbol_conf.use_callchain) {
  290. int indexes[2];
  291. indexes[0] = NEWT_ARG_APPEND;
  292. indexes[1] = NEWT_ARG_LAST;
  293. newt_checkbox_tree__add(tree, s, &self->ms, indexes);
  294. } else
  295. newtListboxAppendEntry(tree, s, &self->ms);
  296. return ret;
  297. }
  298. static void map_symbol__annotate_browser(const struct map_symbol *self,
  299. const char *input_name)
  300. {
  301. FILE *fp;
  302. int cols, rows;
  303. newtComponent form, tree;
  304. struct newtExitStruct es;
  305. char *str;
  306. size_t line_len, max_line_len = 0;
  307. size_t max_usable_width;
  308. char *line = NULL;
  309. if (self->sym == NULL)
  310. return;
  311. if (asprintf(&str, "perf annotate -i \"%s\" -d \"%s\" %s 2>&1 | expand",
  312. input_name, self->map->dso->name, self->sym->name) < 0)
  313. return;
  314. fp = popen(str, "r");
  315. if (fp == NULL)
  316. goto out_free_str;
  317. ui_helpline__push("Press ESC to exit");
  318. newtGetScreenSize(&cols, &rows);
  319. tree = newtListbox(0, 0, rows - 5, NEWT_FLAG_SCROLL);
  320. while (!feof(fp)) {
  321. if (getline(&line, &line_len, fp) < 0 || !line_len)
  322. break;
  323. while (line_len != 0 && isspace(line[line_len - 1]))
  324. line[--line_len] = '\0';
  325. if (line_len > max_line_len)
  326. max_line_len = line_len;
  327. newtListboxAppendEntry(tree, line, NULL);
  328. }
  329. fclose(fp);
  330. free(line);
  331. max_usable_width = cols - 22;
  332. if (max_line_len > max_usable_width)
  333. max_line_len = max_usable_width;
  334. newtListboxSetWidth(tree, max_line_len);
  335. newtCenteredWindow(max_line_len + 2, rows - 5, self->sym->name);
  336. form = newt_form__new();
  337. newtFormAddComponent(form, tree);
  338. newtFormRun(form, &es);
  339. newtFormDestroy(form);
  340. newtPopWindow();
  341. ui_helpline__pop();
  342. out_free_str:
  343. free(str);
  344. }
  345. static const void *newt__symbol_tree_get_current(newtComponent self)
  346. {
  347. if (symbol_conf.use_callchain)
  348. return newtCheckboxTreeGetCurrent(self);
  349. return newtListboxGetCurrent(self);
  350. }
  351. static void hist_browser__selection(newtComponent self, void *data)
  352. {
  353. const struct map_symbol **symbol_ptr = data;
  354. *symbol_ptr = newt__symbol_tree_get_current(self);
  355. }
  356. struct hist_browser {
  357. newtComponent form, tree;
  358. const struct map_symbol *selection;
  359. };
  360. static struct hist_browser *hist_browser__new(void)
  361. {
  362. struct hist_browser *self = malloc(sizeof(*self));
  363. if (self != NULL)
  364. self->form = NULL;
  365. return self;
  366. }
  367. static void hist_browser__delete(struct hist_browser *self)
  368. {
  369. newtFormDestroy(self->form);
  370. newtPopWindow();
  371. free(self);
  372. }
  373. static int hist_browser__populate(struct hist_browser *self, struct hists *hists,
  374. const char *title)
  375. {
  376. int max_len = 0, idx, cols, rows;
  377. struct ui_progress *progress;
  378. struct rb_node *nd;
  379. u64 curr_hist = 0;
  380. char seq[] = ".";
  381. char str[256];
  382. if (self->form) {
  383. newtFormDestroy(self->form);
  384. newtPopWindow();
  385. }
  386. snprintf(str, sizeof(str), "Samples: %Ld ",
  387. hists->stats.total);
  388. newtDrawRootText(0, 0, str);
  389. newtGetScreenSize(NULL, &rows);
  390. if (symbol_conf.use_callchain)
  391. self->tree = newtCheckboxTreeMulti(0, 0, rows - 5, seq,
  392. NEWT_FLAG_SCROLL);
  393. else
  394. self->tree = newtListbox(0, 0, rows - 5,
  395. (NEWT_FLAG_SCROLL |
  396. NEWT_FLAG_RETURNEXIT));
  397. newtComponentAddCallback(self->tree, hist_browser__selection,
  398. &self->selection);
  399. progress = ui_progress__new("Adding entries to the browser...",
  400. hists->nr_entries);
  401. if (progress == NULL)
  402. return -1;
  403. idx = 0;
  404. for (nd = rb_first(&hists->entries); nd; nd = rb_next(nd)) {
  405. struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node);
  406. int len;
  407. if (h->filtered)
  408. continue;
  409. len = hist_entry__append_browser(h, self->tree, hists->stats.total);
  410. if (len > max_len)
  411. max_len = len;
  412. if (symbol_conf.use_callchain)
  413. hist_entry__append_callchain_browser(h, self->tree,
  414. hists->stats.total, idx++);
  415. ++curr_hist;
  416. if (curr_hist % 5)
  417. ui_progress__update(progress, curr_hist);
  418. }
  419. ui_progress__delete(progress);
  420. newtGetScreenSize(&cols, &rows);
  421. if (max_len > cols)
  422. max_len = cols - 3;
  423. if (!symbol_conf.use_callchain)
  424. newtListboxSetWidth(self->tree, max_len);
  425. newtCenteredWindow(max_len + (symbol_conf.use_callchain ? 5 : 0),
  426. rows - 5, title);
  427. self->form = newt_form__new();
  428. if (self->form == NULL)
  429. return -1;
  430. newtFormAddHotKey(self->form, 'A');
  431. newtFormAddHotKey(self->form, 'a');
  432. newtFormAddHotKey(self->form, NEWT_KEY_RIGHT);
  433. newtFormAddComponents(self->form, self->tree, NULL);
  434. self->selection = newt__symbol_tree_get_current(self->tree);
  435. return 0;
  436. }
  437. static struct thread *hist_browser__selected_thread(struct hist_browser *self)
  438. {
  439. int *indexes;
  440. if (!symbol_conf.use_callchain)
  441. goto out;
  442. indexes = newtCheckboxTreeFindItem(self->tree, (void *)self->selection);
  443. if (indexes) {
  444. bool is_hist_entry = indexes[1] == NEWT_ARG_LAST;
  445. free(indexes);
  446. if (is_hist_entry)
  447. goto out;
  448. }
  449. return NULL;
  450. out:
  451. return *(struct thread **)(self->selection + 1);
  452. }
  453. static int hist_browser__title(char *bf, size_t size, const char *input_name,
  454. const struct dso *dso, const struct thread *thread)
  455. {
  456. int printed = 0;
  457. if (thread)
  458. printed += snprintf(bf + printed, size - printed,
  459. "Thread: %s(%d)",
  460. (thread->comm_set ? thread->comm : ""),
  461. thread->pid);
  462. if (dso)
  463. printed += snprintf(bf + printed, size - printed,
  464. "%sDSO: %s", thread ? " " : "",
  465. dso->short_name);
  466. return printed ?: snprintf(bf, size, "Report: %s", input_name);
  467. }
  468. int hists__browse(struct hists *self, const char *helpline, const char *input_name)
  469. {
  470. struct hist_browser *browser = hist_browser__new();
  471. const struct thread *thread_filter = NULL;
  472. const struct dso *dso_filter = NULL;
  473. struct newtExitStruct es;
  474. char msg[160];
  475. int err = -1;
  476. if (browser == NULL)
  477. return -1;
  478. ui_helpline__push(helpline);
  479. hist_browser__title(msg, sizeof(msg), input_name,
  480. dso_filter, thread_filter);
  481. if (hist_browser__populate(browser, self, msg) < 0)
  482. goto out;
  483. while (1) {
  484. const struct thread *thread;
  485. const struct dso *dso;
  486. char *options[16];
  487. int nr_options = 0, choice = 0, i,
  488. annotate = -2, zoom_dso = -2, zoom_thread = -2;
  489. newtFormRun(browser->form, &es);
  490. if (es.reason == NEWT_EXIT_HOTKEY) {
  491. if (toupper(es.u.key) == 'A')
  492. goto do_annotate;
  493. if (es.u.key == NEWT_KEY_ESCAPE ||
  494. toupper(es.u.key) == 'Q' ||
  495. es.u.key == CTRL('c')) {
  496. if (dialog_yesno("Do you really want to exit?"))
  497. break;
  498. else
  499. continue;
  500. }
  501. }
  502. if (browser->selection->sym != NULL &&
  503. asprintf(&options[nr_options], "Annotate %s",
  504. browser->selection->sym->name) > 0)
  505. annotate = nr_options++;
  506. thread = hist_browser__selected_thread(browser);
  507. if (thread != NULL &&
  508. asprintf(&options[nr_options], "Zoom %s %s(%d) thread",
  509. (thread_filter ? "out of" : "into"),
  510. (thread->comm_set ? thread->comm : ""),
  511. thread->pid) > 0)
  512. zoom_thread = nr_options++;
  513. dso = browser->selection->map ? browser->selection->map->dso : NULL;
  514. if (dso != NULL &&
  515. asprintf(&options[nr_options], "Zoom %s %s DSO",
  516. (dso_filter ? "out of" : "into"),
  517. (dso->kernel ? "the Kernel" : dso->short_name)) > 0)
  518. zoom_dso = nr_options++;
  519. options[nr_options++] = (char *)"Exit";
  520. choice = popup_menu(nr_options, options);
  521. for (i = 0; i < nr_options - 1; ++i)
  522. free(options[i]);
  523. if (choice == nr_options - 1)
  524. break;
  525. if (choice == -1)
  526. continue;
  527. do_annotate:
  528. if (choice == annotate) {
  529. if (browser->selection->map->dso->origin == DSO__ORIG_KERNEL) {
  530. ui_helpline__puts("No vmlinux file found, can't "
  531. "annotate with just a "
  532. "kallsyms file");
  533. continue;
  534. }
  535. map_symbol__annotate_browser(browser->selection, input_name);
  536. } else if (choice == zoom_dso) {
  537. if (dso_filter) {
  538. ui_helpline__pop();
  539. dso_filter = NULL;
  540. } else {
  541. ui_helpline__fpush("To zoom out press -> + \"Zoom out of %s DSO\"",
  542. dso->kernel ? "the Kernel" : dso->short_name);
  543. dso_filter = dso;
  544. }
  545. hists__filter_by_dso(self, dso_filter);
  546. hist_browser__title(msg, sizeof(msg), input_name,
  547. dso_filter, thread_filter);
  548. if (hist_browser__populate(browser, self, msg) < 0)
  549. goto out;
  550. } else if (choice == zoom_thread) {
  551. if (thread_filter) {
  552. ui_helpline__pop();
  553. thread_filter = NULL;
  554. } else {
  555. ui_helpline__fpush("To zoom out press -> + \"Zoom out of %s(%d) thread\"",
  556. thread->comm_set ? thread->comm : "",
  557. thread->pid);
  558. thread_filter = thread;
  559. }
  560. hists__filter_by_thread(self, thread_filter);
  561. hist_browser__title(msg, sizeof(msg), input_name,
  562. dso_filter, thread_filter);
  563. if (hist_browser__populate(browser, self, msg) < 0)
  564. goto out;
  565. }
  566. }
  567. err = 0;
  568. out:
  569. hist_browser__delete(browser);
  570. return err;
  571. }
  572. void setup_browser(void)
  573. {
  574. if (!isatty(1))
  575. return;
  576. use_browser = true;
  577. newtInit();
  578. newtCls();
  579. ui_helpline__puts(" ");
  580. }
  581. void exit_browser(bool wait_for_ok)
  582. {
  583. if (use_browser) {
  584. if (wait_for_ok) {
  585. char title[] = "Fatal Error", ok[] = "Ok";
  586. newtWinMessage(title, ok, browser__last_msg);
  587. }
  588. newtFinished();
  589. }
  590. }