@@ -789,27 +789,24 @@ function_profile_call(unsigned long ip, unsigned long parent_ip,
789
789
{
790
790
struct ftrace_profile_stat * stat ;
791
791
struct ftrace_profile * rec ;
792
- unsigned long flags ;
793
792
794
793
if (!ftrace_profile_enabled )
795
794
return ;
796
795
797
- local_irq_save ( flags );
796
+ guard ( preempt_notrace )( );
798
797
799
798
stat = this_cpu_ptr (& ftrace_profile_stats );
800
799
if (!stat -> hash || !ftrace_profile_enabled )
801
- goto out ;
800
+ return ;
802
801
803
802
rec = ftrace_find_profiled_func (stat , ip );
804
803
if (!rec ) {
805
804
rec = ftrace_profile_alloc (stat , ip );
806
805
if (!rec )
807
- goto out ;
806
+ return ;
808
807
}
809
808
810
809
rec -> counter ++ ;
811
- out :
812
- local_irq_restore (flags );
813
810
}
814
811
815
812
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
@@ -856,19 +853,19 @@ static void profile_graph_return(struct ftrace_graph_ret *trace,
856
853
unsigned long long calltime ;
857
854
unsigned long long rettime = trace_clock_local ();
858
855
struct ftrace_profile * rec ;
859
- unsigned long flags ;
860
856
int size ;
861
857
862
- local_irq_save (flags );
858
+ guard (preempt_notrace )();
859
+
863
860
stat = this_cpu_ptr (& ftrace_profile_stats );
864
861
if (!stat -> hash || !ftrace_profile_enabled )
865
- goto out ;
862
+ return ;
866
863
867
864
profile_data = fgraph_retrieve_data (gops -> idx , & size );
868
865
869
866
/* If the calltime was zero'd ignore it */
870
867
if (!profile_data || !profile_data -> calltime )
871
- goto out ;
868
+ return ;
872
869
873
870
calltime = rettime - profile_data -> calltime ;
874
871
@@ -896,9 +893,6 @@ static void profile_graph_return(struct ftrace_graph_ret *trace,
896
893
rec -> time += calltime ;
897
894
rec -> time_squared += calltime * calltime ;
898
895
}
899
-
900
- out :
901
- local_irq_restore (flags );
902
896
}
903
897
904
898
static struct fgraph_ops fprofiler_ops = {
0 commit comments