Permalink
Switch branches/tags
Nothing to show
Commits on May 14, 2013
  1. wrapper.c: added comment on the overall program

    sere authored and andreoli committed May 8, 2013
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Reviewed-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  2. Handle the removal of tracing_enabled file

    sere authored and andreoli committed May 8, 2013
    The file tracing_enabled, once deprecated, has been completely removed
    in kernel 3.7.rc3.
    Handle this by adding a control over the kernel release number.
    
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Reviewed-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Commits on Mar 20, 2013
  1. README.md: add usage and examples for the new "-s" and "-l" options

    ariava authored and andreoli committed Mar 13, 2013
    Now the full-trace.sh script can save generated uprobes to a file
    and load uprobes from a file. This patch adapts the usage in the
    README file to this new behavior and adds an example about these
    newly introduces features.
  2. README.md: adapt to change in behavior about files in /tmp

    ariava authored and andreoli committed Mar 13, 2013
    Now the full-trace.sh script automatically removes all the temporary
    files that could interfere with subsequent runs. This patch adapts
    the README to this new behavior.
  3. full-trace.sh: load uprobes config file

    sere authored and andreoli committed Mar 13, 2013
    This patch adds the possibility to load an alternate uprobes list.
    If the file doesn't exist, this option will force the uprobes generation,
    else it will automatically disable the --uprobes option.
    The behaviour of this option will also override the forcing made by
    --save-uprobes option.
    
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Reviewed-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  4. full-trace.sh: save uprobes on the specified file

    sere authored and andreoli committed Mar 13, 2013
    This patch adds the possibility to save the uprobes list on a file,
    thus permitting to keep uprobes saved between traces of different files.
    When used, this option will force the --uprobes option.
    
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Reviewed-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  5. full-trace.sh: remove /tmp/tovisit, /tmp/visited and tmp/symbols befo…

    sere authored and andreoli committed Mar 13, 2013
    …re creating them
    
    On an attempt to use "fulltrace -u" twice in a row, mkdir complains about
    the existence of the said directories.
    This patch removes those error messages by deleting the directories before
    trying to create them.
    This also prevents any undesired effects caused by the files present
    in said directories.
    
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Reviewed-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  6. full-trace.sh: check if the user wants to exit on "sudo -v" command

    sere authored and andreoli committed Mar 13, 2013
    This patch adds a control on the exit state of "sudo -v" command
    and make full-trace.sh exits if it's abnormal.
    Before, an exit attempt on the first password prompt resulted in
    a multiple password check due to the continuation of the program.
    Now, an exit attempt on the first password propt results in
    the termination of the program with code 1.
    
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Reviewed-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  7. full-trace.sh: move the prompt for password after the initial checks

    sere authored and andreoli committed Mar 13, 2013
    This patch attempts to reduce the number of cases in which a password
    request is done right before a program failure.
    This is done by moving "sudo -v" command from before to after the check
    on the existence of the mandatory argument.
    This patch also moves a variable declaration that also causes this behaviour.
    
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Reviewed-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  8. wrapper.c: enable traces only after setting PID filter

    ariava authored and andreoli committed Mar 13, 2013
    Currently, the full-trace.sh script enables tracing before the
    wrapper executable has any chance of setting the PID filter. This
    results in a brief tracing window where any event from any process
    will be traced. This patch lets wrapper.c decide when tracing should
    be enabled. This also removes from full-trace.sh the lines that
    enable the ftrace subsystem.
    
    Reported-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  9. full-trace.sh: check if given executable exists

    ariava authored and andreoli committed Mar 13, 2013
    The full-trace.sh script uses the which command to determine the
    full path of the executable that must be traced. However, it does
    not perform any check on the existence of such an executable.
    This may result in an erratic behavior of the script and in non
    explicative errors. This patch attempts to fix the issue by checking
    whether the which command actually finds the given executable and
    printing the usage of the full-trace.sh script instead of an error
    message of the which command.
    
    Reported-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  10. full-trace.sh: clear set_ftrace_pid tunable in ftrace_off()

    ariava authored and andreoli committed Mar 13, 2013
    The full-trace.sh script does not clear the PID filter of the ftrace
    subsystem before exiting. This does not result in any error of the
    fulltrace utility, as the filter is always cleared and re-set when
    a trace is started, but it may give issues if someone uses the ftrace
    subsystem for other purposes after running fulltrace. This patch
    lets the ftrace_off() function clear the PID filter.
    
    Reported-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  11. wrapper.c: fix some small issues

    ariava authored and andreoli committed Mar 13, 2013
    This patch attempts to fix some small issues in the wrapper program.
    * The initial check on the number of arguments has been fixed to
      return when the wrapper executable has been given less than two
      command-line arguments (the first always exists, as argv[0] is
      the executable name).
    * About the write() system call used in the program:
      - the type of the return value has been modified to be ssize_t;
      - the type of the second parameter been modified to be void *;
      - the type of the third parameter has been modified to be size_t.
    * The perror() function is used to print error messages.
    * A die() function has been introduced to allow the process to
      cleanly exit when a write error is encountered (which means that
      a file is currently open and must be closed before exiting).
    
    Reported-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  12. full-trace.sh: fix regexps in add-userspace-functions-duration()

    ariava authored and andreoli committed Mar 13, 2013
    The full-trace.sh script uses regexps to identify entry and exit
    points for userspace functions. Unfortunately, both the regexps had
    extra spaces and never matched. This patch fixes the issue.
    
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
    Reviewed-by: Serena Ziviani <senseriumi@gmail.com>
  13. full-trace.sh: fix regexp in remove-spurious-uprobes()

    ariava authored and andreoli committed Mar 13, 2013
    The full-trace.sh script uses a regexp to identify uprobe events
    in the ftrace output. The regexp, however, did not correctly match
    uprobe events for two reasons: 1) it had extra spaces; 2) it checked
    only for C-styled comments, which are also present in some ordinary
    ftrace events. This patch fixes the issues by using a better regexp
    and removing the extra spaces.
    
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
    Reviewed-by: Serena Ziviani <senseriumi@gmail.com>
Commits on Mar 3, 2013
  1. README.md: update usage examples

    ariava authored and andreoli committed Mar 2, 2013
    This patch adds to the README.md file a paragraph about the newly
    inserted feature that allows fulltrace to check the configuration of
    the currently running kernel. It also adds root privileges as a
    prerequisite of the execution of the main script, and fixes a small
    typo.
  2. full-trace.sh: check configuration of running kernel

    ariava authored and andreoli committed Mar 2, 2013
    The fulltrace utility relies on the presence of some features built
    in the current kernel. This patch lets the full-trace.sh script
    check whether the kernel configuration includes all the needed
    options. The script initially tries to retrieve the configuration of
    the running kernel from the /proc/config.gz interface. If this file does
    not exist, a second attempt is done to find the configuration as the
    /boot/config-<running kernel version> file. If none of these attempts
    succeeds, fulltrace terminates. If a valid configuration file is found,
    fulltrace may either run successfully (if all the needed options are
    found to be present) or exit with a list of missing configuration
    options.
    This patch also adds a "-i" option that allows the user to ignore the
    configuration check. It is however not possible to skip the check if
    the uprobes subsystem is missing in the debugfs.
    
    Reported-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  3. full-trace.sh: make checks on uprobe-related files sudo-compliant

    ariava authored and andreoli committed Mar 2, 2013
    The access to the debugfs has been restricted from kernel 3.7 on.
    Every check on the existence of uprobe-related files must be done
    with root privileges. This patch adds sudo to every test done on
    such files.
Commits on Feb 25, 2013
  1. README.md: fix TOC and add a paragraph on ftrace buffer sizing

    ariava authored and andreoli committed Feb 12, 2013
    The README.md file contains a table of contents, whose bullets are
    links to the specific paragraphs. The file used anchor tags to define
    the internal hyperlinks; however, the special github Markdown plugins
    automatically define anchor points for each paragraph. This patch
    attempts to adapt the TOC to play along nicely with the auto-generated
    anchor points.
    This patch also adds a brief paragraph and an usage example for the
    -b option of the full-trace.sh script, that allows the user to specify
    the per-CPU ftrace buffer.
  2. full-trace.sh: check if the mandatory argument has been given

    ariava authored and andreoli committed Feb 10, 2013
    The full-trace.sh script needs to know which command is to be
    traced. However, no check is performed on the presence of such
    an argument. This results in non-explicative errors during the
    execution of the script. This patch adds a check on the presence
    of this mandatory argument and possibly notifies the user about
    its absence, printing also the script usage.
Commits on Feb 11, 2013
  1. full-trace.sh: reformat of awk scripts

    sere authored and andreoli committed Feb 5, 2013
    Reformat of the awk parts in remove-spurious-uprobes() and
    add-userspace-functions-duration() functions.
    
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
  2. full-trace.sh: check if uprobes exist before enabling them

    ariava authored and andreoli committed Feb 4, 2013
    Currently, the full-trace.sh script always enables uprobes tracing,
    even if no uprobes have been planted. This results in an error, as
    the uprobes subsystem has not been enabled and the /tmp/uprobes
    file does not exist. This patch introduces checks on the existence
    of the affected files before any command touches them. In case no
    uprobe has been planted, the uprobes_on() function will print a
    warning message to standard output.
    
    Reported-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Commits on Jan 22, 2013
  1. full-trace.sh: making fulltrace sudo compliant

    sere authored and andreoli committed Jan 20, 2013
    Starting with kernel v3.7, the debugfs file system is unaccessible
    without root privileges.
    This patch adds sudo to every access at /sys/kernel/debug/, and sudo -v
    at the beginning of the script, to ensure that the cache credentials are
    updated.
  2. full-trace.sh: check first and last indexes before trimming the trace

    ariava authored and andreoli committed Jan 20, 2013
    The full-trace.sh script, in its write_trace() function, trims the
    trace output by searching for the first and last context switches of
    the traced process. It may happen, though, that a trace does not
    cover all the execution of the traced process, and therefore does not
    include context switches, or they are not in the expected order. This
    would result in an uncorrect trimming of the trace output. This patch
    addresses some of the corner-case failures concerning those indexes.
    The patch also lets the trace output keep the dashed line at the end
    of the last context switch.
    
    Reported-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Serena Ziviani <senseriumi@gmail.com>
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
  3. fulltrace.sh: changed the buffer's heuristic to comply with ftrace

    sere authored and andreoli committed Jan 14, 2013
    ftrace uses the number of possible CPUs instead of the number of present CPUs
    to compute the size of the per CPU ring buffer. "Possible" refers to the number
    of CPUs supported by the chipset, "present" refers instead to the number of
    physically present CPUs in the system (which can be both online and offline).
    On some machines these values are different, so we need to consider the actual
    number of possible CPUs.
Commits on Jan 18, 2013
  1. README.md: add documentation

    andreoli committed Jan 18, 2013
    The following patch (contributed by Arianna Avanzini) adds some
    documentation about the configuration and usage of fulltrace.
Commits on Jan 9, 2013
  1. full-trace.sh: fix a nasty bug in uprobes_on()

    andreoli committed Jan 9, 2013
    For some weird reason, the following pipeline:
    
    cat /tmp/uprobes | sudo tee -a /sys/kernel/debug/tracing/uprobe_events
    
    fails halfway with an "Invalid argument error". The following
    patch modifies uprobes_on() in order to write each probe into
    /sys/kernel/debug/tracing/uprobe_events.
  2. full-trace.sh: use split command with "-l" option

    ariava authored and andreoli committed Dec 24, 2012
    The full-trace.sh script uses the split command to divide the original
    ftrace output in chunks according to the number of CPUs; this is
    implemented by using the split command with its "-n" option, that
    accepts as a parameter the number of chunks.
    Unfortunately, some versions of the split command don't support such
    an option. Use the "-l" option instead, that accepts as a parameter
    the number of lines per chunk; dynamically compute the number of lines
    to be kept in each chunk according to the total number of lines of the
    original ftrace output and the number of CPUs.
Commits on Dec 17, 2012
  1. full-trace.sh: kill all threads on SIGINT and SIGTERM

    ariava authored and andreoli committed Dec 17, 2012
    During the operations related to trace decoding, the full-trace.sh
    script divides the global workload into different threads. For
    this reason, an interrupt does not really stop the program. This
    commit traps SIGINT and SIGTERM, killing all the full-trace.sh
    threads.
Commits on Dec 16, 2012
  1. full-trace.sh: fix mistake in add-userspace-functions-duration()

    ariava authored and andreoli committed Dec 16, 2012
    The awk script in the add-userspace-functions-duration() function uses
    temporary variables to store the PID read from the current trace line.
    One of the branches used one of the variables without correctly
    initializing it (the result is that the value inserted in the previous
    computation was used).
  2. full-trace.sh: remove debug string in add-userspace-functions-duration()

    ariava authored and andreoli committed Dec 16, 2012
    Commit 4cd7497 added to every uprobe exit event a string with the
    PID and the timestamp recorded in the matching entry action. It
    was done to verify the correctness of the algorithm: this commit
    removes the extra string.
  3. full-trace.sh: compute userspace function duration better

    ariava authored and andreoli committed Dec 16, 2012
    The add-userspace-functions-duration() function suffers from the
    following limitations:
    - it cannot handle recursion: the default behaviour has the function
      timestamp overwritten every time a new entry uprobe event for a
      recursive function is seen, which results in wrong computations and
      entry-exit mismatches;
    - it does not separate uprobe events between different threads
      belonging to the same application.
    This commit adds a stack-based algorithm to handle recursion, and
    allows the add-userspace-functions-duration() function to correctly
    track uprobe events from different threads. This also updates the
    comment to the function.
  4. full-trace.sh: use process shortname to remove spurious uprobe events

    ariava authored and andreoli committed Dec 16, 2012
    Previously, the remove-spurious-uprobes() function used the CPU number
    to filter out uprobe events that didn't execute on the same CPU as
    the main process. While tracing a multithreaded application, this
    leads to randomly deleting events from threads belonging to the
    traced application. This commit lets the function use, instead, the
    shortname of the process (that is the process name truncated to seven
    characters max).
  5. full-trace.sh: insert the process shortname and PID in the trace output

    ariava authored and andreoli committed Dec 16, 2012
    This commit activates the "funcgraph-proc" ftrace option, which
    prints the process shortname and kernel PID for every event recorded
    in the trace output. This also adapts the full-trace.sh script to
    work with the new trace format.
  6. full-trace.sh: fix format of userspace function duration

    ariava authored and andreoli committed Dec 16, 2012
    The format specifier for the field added to the trace output by the
    add-userspace-functions-duration() is missing the total field width.
    This commit adds it.