cregit-Linux how code gets into the kernel

Release 4.10 tools/perf/util/usage.c

Directory: tools/perf/util
/*
 * usage.c
 *
 * Various reporting routines.
 * Originally copied from GIT source.
 *
 * Copyright (C) Linus Torvalds, 2005
 */
#include "util.h"
#include "debug.h"


static void report(const char *prefix, const char *err, va_list params) { char msg[1024]; vsnprintf(msg, sizeof(msg), err, params); fprintf(stderr, " %s%s\n", prefix, msg); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar50100.00%2100.00%
Total50100.00%2100.00%


static NORETURN void usage_builtin(const char *err) { fprintf(stderr, "\n Usage: %s\n", err); exit(129); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar26100.00%2100.00%
Total26100.00%2100.00%


static NORETURN void die_builtin(const char *err, va_list params) { report(" Fatal: ", err, params); exit(128); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar29100.00%2100.00%
Total29100.00%2100.00%


static void error_builtin(const char *err, va_list params) { report(" Error: ", err, params); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar23100.00%2100.00%
Total23100.00%2100.00%


static void warn_builtin(const char *warn, va_list params) { report(" Warning: ", warn, params); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar23100.00%2100.00%
Total23100.00%2100.00%

/* If we are in a dlopen()ed .so write to a global variable would segfault * (ugh), so keep things static. */ static void (*usage_routine)(const char *err) NORETURN = usage_builtin; static void (*error_routine)(const char *err, va_list params) = error_builtin; static void (*warn_routine)(const char *err, va_list params) = warn_builtin;
void set_warning_routine(void (*routine)(const char *err, va_list params)) { warn_routine = routine; }

Contributors

PersonTokensPropCommitsCommitProp
namhyung kimnamhyung kim24100.00%1100.00%
Total24100.00%1100.00%


void usage(const char *err) { usage_routine(err); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar15100.00%1100.00%
Total15100.00%1100.00%


void die(const char *err, ...) { va_list params; va_start(params, err); die_builtin(err, params); va_end(params); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar3397.06%150.00%
arnaldo carvalho de meloarnaldo carvalho de melo12.94%150.00%
Total34100.00%2100.00%


int error(const char *err, ...) { va_list params; va_start(params, err); error_routine(err, params); va_end(params); return -1; }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar38100.00%1100.00%
Total38100.00%1100.00%


void warning(const char *warn, ...) { va_list params; va_start(params, warn); warn_routine(warn, params); va_end(params); }

Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar34100.00%1100.00%
Total34100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
ingo molnaringo molnar32691.83%233.33%
namhyung kimnamhyung kim257.04%233.33%
arnaldo carvalho de meloarnaldo carvalho de melo41.13%233.33%
Total355100.00%6100.00%
Directory: tools/perf/util
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.