tmp_suning_uos_patched/kernel/trace
Jiri Olsa eda1e32855 tracing: handle broken names in ftrace filter
If one filter item (for set_ftrace_filter and set_ftrace_notrace) is being
setup by more than 1 consecutive writes (FTRACE_ITER_CONT flag), it won't
be handled corretly.

I used following program to test/verify:

[snip]
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

int main(int argc, char **argv)
{
        int fd, i;
        char *file = argv[1];

        if (-1 == (fd = open(file, O_WRONLY))) {
                perror("open failed");
                return -1;
        }

        for(i = 0; i < (argc - 2); i++) {
                int len = strlen(argv[2+i]);
                int cnt, off = 0;

                while(len) {
                        cnt = write(fd, argv[2+i] + off, len);
                        len -= cnt;
                        off += cnt;
                }
        }

        close(fd);
        return 0;
}
[snip]

before change:
sh-4.0# echo > ./set_ftrace_filter
sh-4.0# /test ./set_ftrace_filter "sys" "_open "
sh-4.0# cat ./set_ftrace_filter
#### all functions enabled ####
sh-4.0#

after change:
sh-4.0# echo > ./set_ftrace_notrace
sh-4.0# test ./set_ftrace_notrace "sys" "_open "
sh-4.0# cat ./set_ftrace_notrace
sys_open
sh-4.0#

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
LKML-Reference: <20090811152904.GA26065@jolsa.lab.eng.brq.redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-08-18 20:39:48 -04:00
..
blktrace.c Remove double removal of blktrace directory 2009-08-12 18:50:08 +02:00
ftrace.c tracing: handle broken names in ftrace filter 2009-08-18 20:39:48 -04:00
Kconfig tracing/fastboot: Document the need of initcall_debug 2009-06-29 10:22:10 +02:00
kmemtrace.c
Makefile
ring_buffer_benchmark.c ring-buffer: have benchmark test print to trace buffer 2009-06-17 17:01:09 -04:00
ring_buffer.c ring-buffer: Fix memleak in ring_buffer_free() 2009-08-07 12:46:39 -04:00
trace_boot.c
trace_branch.c
trace_clock.c
trace_event_profile.c ftrace: Fix perf-tracepoint OOPS 2009-08-06 06:26:09 +02:00
trace_event_types.h trace_export: Repair missed fields 2009-06-26 20:48:40 +02:00
trace_events_filter.c tracing/filters: Always free pred on filter_add_subsystem_pred() failure 2009-08-08 17:56:13 +02:00
trace_events.c ftrace: Fix perf-tracepoint OOPS 2009-08-06 06:26:09 +02:00
trace_export.c
trace_functions_graph.c tracing: Fix invalid function_graph entry 2009-07-28 23:17:23 +02:00
trace_functions.c tracing/function: Fix the return value of ftrace_trace_onoff_callback() 2009-07-16 23:34:32 -04:00
trace_hw_branches.c
trace_irqsoff.c
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: Fix trace_print_seq() 2009-07-02 08:51:13 +02:00
trace_output.h
trace_power.c
trace_printk.c tracing: show proper address for trace-printk format 2009-07-23 10:07:17 -04:00
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest_dynamic.c
trace_selftest.c
trace_stack.c trace_stack: Fix seqfile memory leak 2009-07-23 09:52:09 -04:00
trace_stat.c tracing/stat: Fix seqfile memory leak 2009-07-23 09:53:55 -04:00
trace_stat.h
trace_syscalls.c
trace_sysprof.c
trace_workqueue.c
trace.c ftrace: Unify effect of writing to trace_options and option/* 2009-08-18 02:07:04 +02:00
trace.h perf_counter: Fix/complete ftrace event records sampling 2009-08-09 12:53:48 +02:00