rtla: Real-Time Linux Analysis tool
The rtla is a meta-tool that includes a set of commands that aims to analyze the real-time properties of Linux. But instead of testing Linux as a black box, rtla leverages kernel tracing capabilities to provide precise information about the properties and root causes of unexpected results. rtla --help works and provide information about the available options. This is just the "main" and the Makefile, no function yet. Link: https://lkml.kernel.org/r/bf9118ed43a09e6c054c9a491cbe7411ad1acd89.1639158831.git.bristot@kernel.org Cc: Tao Zhou <tao.zhou@linux.dev> Cc: Ingo Molnar <mingo@redhat.com> Cc: Tom Zanussi <zanussi@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Clark Williams <williams@redhat.com> Cc: John Kacur <jkacur@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Daniel Bristot de Oliveira <bristot@kernel.org> Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
committed by
Steven Rostedt
parent
0878355b51
commit
79ce8f43ac
72
tools/tracing/rtla/src/rtla.c
Normal file
72
tools/tracing/rtla/src/rtla.c
Normal file
@@ -0,0 +1,72 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2021 Red Hat Inc, Daniel Bristot de Oliveira <bristot@kernel.org>
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* rtla_usage - print rtla usage
|
||||
*/
|
||||
static void rtla_usage(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
static const char *msg[] = {
|
||||
"",
|
||||
"rtla version " VERSION,
|
||||
"",
|
||||
" usage: rtla COMMAND ...",
|
||||
"",
|
||||
" commands:",
|
||||
"",
|
||||
NULL,
|
||||
};
|
||||
|
||||
for (i = 0; msg[i]; i++)
|
||||
fprintf(stderr, "%s\n", msg[i]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* run_command - try to run a rtla tool command
|
||||
*
|
||||
* It returns 0 if it fails. The tool's main will generally not
|
||||
* return as they should call exit().
|
||||
*/
|
||||
int run_command(int argc, char **argv, int start_position)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int retval;
|
||||
|
||||
/* is it an alias? */
|
||||
retval = run_command(argc, argv, 0);
|
||||
if (retval)
|
||||
exit(0);
|
||||
|
||||
if (argc < 2)
|
||||
goto usage;
|
||||
|
||||
if (strcmp(argv[1], "-h") == 0) {
|
||||
rtla_usage();
|
||||
exit(0);
|
||||
} else if (strcmp(argv[1], "--help") == 0) {
|
||||
rtla_usage();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
retval = run_command(argc, argv, 1);
|
||||
if (retval)
|
||||
exit(0);
|
||||
|
||||
usage:
|
||||
rtla_usage();
|
||||
exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user