Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182431
b: refs/heads/master
c: 4c57415
h: refs/heads/master
i:
  182429: e4a5785
  182427: da00e1a
  182423: 52b2c8d
  182415: d189f0f
  182399: c01428d
v: v3
  • Loading branch information
Thiago Farina authored and Ingo Molnar committed Jan 29, 2010
1 parent 56cd34b commit ab701cc
Show file tree
Hide file tree
Showing 2 changed files with 12 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: ae7f6711d6231c9ba54feb5ba9856c3775e482f8
refs/heads/master: 4c574159d03f4d8a136a7adff2d0b1d82cadcb18
21 changes: 11 additions & 10 deletions trunk/tools/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ int check_pager_config(const char *cmd)
return c.val;
}

static void commit_pager_choice(void) {
static void commit_pager_choice(void)
{
switch (use_pager) {
case 0:
setenv("PERF_PAGER", "cat", 1);
Expand All @@ -70,7 +71,7 @@ static void set_debugfs_path(void)
"tracing/events");
}

static int handle_options(const char*** argv, int* argc, int* envchanged)
static int handle_options(const char ***argv, int *argc, int *envchanged)
{
int handled = 0;

Expand Down Expand Up @@ -109,7 +110,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--perf-dir")) {
if (*argc < 2) {
fprintf(stderr, "No directory given for --perf-dir.\n" );
fprintf(stderr, "No directory given for --perf-dir.\n");
usage(perf_usage_string);
}
setenv(PERF_DIR_ENVIRONMENT, (*argv)[1], 1);
Expand All @@ -124,7 +125,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--work-tree")) {
if (*argc < 2) {
fprintf(stderr, "No directory given for --work-tree.\n" );
fprintf(stderr, "No directory given for --work-tree.\n");
usage(perf_usage_string);
}
setenv(PERF_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
Expand Down Expand Up @@ -168,7 +169,7 @@ static int handle_alias(int *argcp, const char ***argv)
{
int envchanged = 0, ret = 0, saved_errno = errno;
int count, option_count;
const char** new_argv;
const char **new_argv;
const char *alias_command;
char *alias_string;

Expand Down Expand Up @@ -210,11 +211,11 @@ static int handle_alias(int *argcp, const char ***argv)
if (!strcmp(alias_command, new_argv[0]))
die("recursive alias: %s", alias_command);

new_argv = realloc(new_argv, sizeof(char*) *
new_argv = realloc(new_argv, sizeof(char *) *
(count + *argcp + 1));
/* insert after command name */
memcpy(new_argv + count, *argv + 1, sizeof(char*) * *argcp);
new_argv[count+*argcp] = NULL;
memcpy(new_argv + count, *argv + 1, sizeof(char *) * *argcp);
new_argv[count + *argcp] = NULL;

*argv = new_argv;
*argcp += count - 1;
Expand Down Expand Up @@ -450,8 +451,8 @@ int main(int argc, const char **argv)
setup_path();

while (1) {
static int done_help = 0;
static int was_alias = 0;
static int done_help;
static int was_alias;

was_alias = run_argv(&argc, &argv);
if (errno != ENOENT)
Expand Down

0 comments on commit ab701cc

Please sign in to comment.