Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191127
b: refs/heads/master
c: f3a1f0e
h: refs/heads/master
i:
  191125: 8ce2130
  191123: b264995
  191119: 18378e7
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Mar 22, 2010
1 parent f498618 commit 1535140
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 301fde27c7fcd0380b02b175d547e894ff65d78a
refs/heads/master: f3a1f0ea9432ec395cd112f42201e8e523c07bc5
4 changes: 2 additions & 2 deletions trunk/tools/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
set_debugfs_path();

status = p->fn(argc, argv, prefix);
exit_browser(status);

if (status)
return status & 0xff;

exit_browser();

/* Somebody closed stdout? */
if (fstat(fileno(stdout), &st))
return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/util/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ static inline void setup_browser(void)
{
setup_pager();
}
static inline void exit_browser(void) {}
static inline void exit_browser(bool wait_for_ok __used) {}
#else
void setup_browser(void);
void exit_browser(void);
void exit_browser(bool wait_for_ok);
#endif

extern const char *editor_program;
Expand Down
19 changes: 13 additions & 6 deletions trunk/tools/perf/util/newt.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,20 @@ void perf_session__browse_hists(struct rb_root *hists, u64 session_total,
newtFormDestroy(form);
}

static char browser__last_msg[1024];

int browser__show_help(const char *format, va_list ap)
{
int ret;
static int backlog;
static char msg[1024];

ret = vsnprintf(msg + backlog, sizeof(msg) - backlog, format, ap);
ret = vsnprintf(browser__last_msg + backlog,
sizeof(browser__last_msg) - backlog, format, ap);
backlog += ret;

if (msg[backlog - 1] == '\n') {
if (browser__last_msg[backlog - 1] == '\n') {
newtPopHelpLine();
newtPushHelpLine(msg);
newtPushHelpLine(browser__last_msg);
newtRefresh();
backlog = 0;
}
Expand All @@ -200,8 +202,13 @@ void setup_browser(void)
newtPushHelpLine(" ");
}

void exit_browser(void)
void exit_browser(bool wait_for_ok)
{
if (use_browser)
if (use_browser) {
if (wait_for_ok) {
char title[] = "Fatal Error", ok[] = "Ok";
newtWinMessage(title, ok, browser__last_msg);
}
newtFinished();
}
}

0 comments on commit 1535140

Please sign in to comment.