aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/sched-migration.py
diff options
context:
space:
mode:
authorMiroslav Benes <mbenes@suse.cz>2017-05-26 08:45:21 -0400
committerJiri Kosina <jkosina@suse.cz>2017-05-26 18:27:37 -0400
commit5720acf4bfc142ba568d5b6782fceaf62ed15e0b (patch)
tree1710c0e1717f88eb51d7c6536e357de89f6b076c /tools/perf/scripts/python/sched-migration.py
parent76f1948a79b26d5f57a5ee9941876b745c6baaea (diff)
livepatch: Make livepatch dependent on !TRIM_UNUSED_KSYMS
If TRIM_UNUSED_KSYMS is enabled, all unneeded exported symbols are made unexported. Two-pass build of the kernel is done to find out which symbols are needed based on a configuration. This effectively complicates things for out-of-tree modules. Livepatch exports functions to (un)register and enable/disable a live patch. The only in-tree module which uses these functions is a sample in samples/livepatch/. If the sample is disabled, the functions are trimmed and out-of-tree live patches cannot be built. Note that live patches are intended to be built out-of-tree. Suggested-by: Michal Marek <mmarek@suse.com> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Jessica Yu <jeyu@redhat.com> Signed-off-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions
c466f990
0012693ad4f6


16444a8a40d4
c79a61f55773

2f5f6ad9390c








ccf3672d5301












de47725421ad
04da85b86188

606576ce8166
3e1932ad5972
b0fc494fae96


8d65af789f3e
b0fc494fae96

2f5f6ad9390c


a1e2e31d175a
16444a8a40d4
e248491ac283













08f6fba50311













4740974a6844



e248491ac283
b848914ce395
08f6fba50311





4740974a6844
b848914ce395

16444a8a40d4
f45948e898e7

b848914ce395
e248491ac283
f45948e898e7



16444a8a40d4

60a7ecf42661

e7d3737ea1b1










60a7ecf42661

























16444a8a40d4










e248491ac283
















































a1e2e31d175a

16444a8a40d4
606576ce8166
4dbf6bc239c1





ea701f11da44



4dbf6bc239c1
81adbdc029ec
60a7ecf42661

606576ce8166
352ad25aa4a1
f38f1d2aa5a3



8d65af789f3e
f38f1d2aa5a3


f6180773d905


43dd61c9a09b

f6180773d905


3d0833953e1b
31e889098a80
000ab691172d


c88fd8634ea6

809dcf29ce4e

b6887d7916e4
59df055f1991




809dcf29ce4e

b6887d7916e4
809dcf29ce4e
59df055f1991


b6887d7916e4
59df055f1991

b6887d7916e4
59df055f1991

b6887d7916e4

59df055f1991
2cfa19780d61

ea701f11da44

08f6fba50311
















3c1720f00bb6
08f6fba50311


3c1720f00bb6

08f6fba50311

ed926f9b35cd
3d0833953e1b
ee000b7f9fe4



85ae32ae019b
ee000b7f9fe4
3d0833953e1b

e1c08bdd9fa7
647664eaf403

ac483c446b67
936e074b286a
ac483c446b67
936e074b286a


5500fa51199a
e1c08bdd9fa7
f6180773d905


c88fd8634ea6







08f6fba50311











c88fd8634ea6


08f6fba50311

c88fd8634ea6


fc13cb0ce452



69a3083c4a7d


fc13cb0ce452

c88fd8634ea6







08d636b6d4fb





c88fd8634ea6


f0cf973a224a
c88fd8634ea6


fc13cb0ce452








2a85a37f168d


3d0833953e1b
3c1720f00bb6
d61f82d06672
e4f5d5440bb8
d61f82d06672

08f6fba50311
d61f82d06672
08f6fba50311
d61f82d06672
f00012074b1a
8ed3e2cfe40f

f00012074b1a


08f6fba50311








fb52607afcd0

5a45cfe1c648




e7d3737ea1b1
ad90c0e3ce8d
31e889098a80
57794a9d48b6
31e889098a80




















a26a2a27396c
593eb8a2d63e
31e889098a80


593eb8a2d63e






31e889098a80

593eb8a2d63e






31e889098a80

08f6fba50311
































31e889098a80

593eb8a2d63e
ecea656d1d5e

c0719e5a4b1c

4dc936769e8a
4dbf6bc239c1

4dbf6bc239c1

e7247a15ff3b
f6180773d905

97d0bb8dcd8c
f6180773d905


97d0bb8dcd8c
f6180773d905
2cfa19780d61



4dc936769e8a



fc13cb0ce452






96de37b62ca5
647664eaf403
5500fa51199a


fc13cb0ce452










ecea656d1d5e
352ad25aa4a1
aeaee8a2c9cb


f43fdad8627f

606576ce8166
f43fdad8627f



3700273586ee

9bdeb7b5d34f
3700273586ee

9bdeb7b5d34f

606576ce8166
9bdeb7b5d34f









606576ce8166
9bdeb7b5d34f



c79a61f55773


















352ad25aa4a1
81d68a96a398
489f13961459

81d68a96a398
4dbf6bc239c1

81d68a96a398

6cd8a4bb2f97
489f13961459

6cd8a4bb2f97
b02ee9a33b65





6cd8a4bb2f97

68bf21aa15c8





71566a0d161e
287b6e68ca72





dd0e545f061f
71566a0d161e
caf4b323b02a

fb52607afcd0
caf4b323b02a


0231022cc32d

287b6e68ca72
caf4b323b02a

62b915f10609



fb52607afcd0
8b96f0119818
5ac9f62267dc
f876d346e380
5ac9f62267dc
8b96f0119818
712406a6bf59







a2a16d6a3156
71e308a239c0
712406a6bf59









71e308a239c0

712406a6bf59

8b96f0119818





bcbc4f20b52c









f201ae2356c7

287b6e68ca72


14a866c567e0

287b6e68ca72


caf4b323b02a
fb52607afcd0
f201ae2356c7
fb52607afcd0

868baf07b1a2
21a8c466f990




380c4b1411cc









5ac9f62267dc
8b96f0119818

bcbc4f20b52c
5ac9f62267dc
8b96f0119818
fb52607afcd0

868baf07b1a2
21a8c466f990
62b915f10609






21a8c466f990



380c4b1411cc


5ac9f62267dc
caf4b323b02a
ea4e2bc4d9f7
ea4e2bc4d9f7








































cecbca96da38


526211bc58c4
261842b7c909



ea4e2bc4d9f7

261842b7c909


b1818748b0cf
e7b8e675d9c7





16444a8a40d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838




                                                                        


                       
                              
                           
                          
                         
                         
                        
                        


                        
 

                       








                                                         












                                                                        
              

                   
                             
 


                                                        
                                                       

                                   


                                                                        
                                                                           
 













                                                                     













                                                                               



                                                                                 
   
      





                                                         
                                                         

  
                   

                                              
                                              
                                                  



                                                      

  

                               










                                                                     

























                                                                       










                                                                      
















































                                                                              

                                                                     
 
                                   





                                                                       



                                                
                                                  
                                        

                                         
                                   
 



                                                      
                                                     


                                 


                                      

                                                                 


                                                                  
                            
 


                                               

                                           

                
                         




                                                                           

                                                            
                                                                      
                                                     


          
                                                                        

                                          
                                                                          

                                            

                                                                                
 

                                                        

                                          
















                                                                    
      


                                              

  

                                                 
 
                   



                                                                             
                                      
                                             

  
                              

                                                                  
                                                                 
                                           
                                                                  


                                                                       
                                                
 


                                                               







                                                   











                                                                    


                                

                                       


                               



                                           


                                           

  







                                                                           





                                                 


                                                             
                                                


                                           








                                                                        


                                                                       
                     
                                                 
                                            
                                            

                                                         
                                     
                              
                                   
                              
 

                                         


                                                  








                                                             

                                      




                                                                        
      
 
   
                                          




















                                                                       
 
   


                                                                 






                                                               

                                               






                                                

                                                                        
































                                                                                    

                                                          
 

                                        

                                        
                                 

                                                            

                                                  
                                                            

                                                                          
                       


                                                           
                       
 



                                                              



                                                             






                                                                
                                                                  
                                                                   


                                                               










                                                                                      
                                  
 


                                                           

                                       
                             



                           

                                                                      
                                                               

                   

                                             
                             









                                                        
                             



                                 


















                                                                   
 
                            

                                                                    
     

                                                                              

      
                            

                                                                    
     





                                                                               

      





                                        
  





                                                  
 
  

                                                  
                         


                                                  

                                                                               
                  

  



                                                                               
                                   
 
                   
                                                          
 
  







                                          
                                   
                         









                                         

                                                                           

  





                                                                     









                                                                               

                                     


                                                                  

                                    


                                                  
 
                                          
 

                                                          
                                                                        




                                                            









                                                  
                                         

                           
                   
                         
 

                                                                    
                                                                                  
 






                                                                       



                                                              


                                                  
                                         
 
                     








































                                                                 


                                                 
 



                                                             

                           


                            
 





                                        
                            
/*
 * Ftrace header.  For implementation details beyond the random comments
 * scattered below, see: Documentation/trace/ftrace-design.txt
 */

#ifndef _LINUX_FTRACE_H
#define _LINUX_FTRACE_H

#include <linux/trace_clock.h>
#include <linux/kallsyms.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
#include <linux/ptrace.h>
#include <linux/ktime.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/fs.h>

#include <asm/ftrace.h>

/*
 * If the arch supports passing the variable contents of
 * function_trace_op as the third parameter back from the
 * mcount call, then the arch should define this as 1.
 */
#ifndef ARCH_SUPPORTS_FTRACE_OPS
#define ARCH_SUPPORTS_FTRACE_OPS 0
#endif

/*
 * If the arch's mcount caller does not support all of ftrace's
 * features, then it must call an indirect function that
 * does. Or at least does enough to prevent any unwelcomed side effects.
 */
#if !defined(CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST) || \
	!ARCH_SUPPORTS_FTRACE_OPS
# define FTRACE_FORCE_LIST_FUNC 1
#else
# define FTRACE_FORCE_LIST_FUNC 0
#endif


struct module;
struct ftrace_hash;

#ifdef CONFIG_FUNCTION_TRACER

extern int ftrace_enabled;
extern int
ftrace_enable_sysctl(struct ctl_table *table, int write,
		     void __user *buffer, size_t *lenp,
		     loff_t *ppos);

struct ftrace_ops;

typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip,
			      struct ftrace_ops *op, struct pt_regs *regs);

/*
 * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are
 * set in the flags member.
 *
 * ENABLED - set/unset when ftrace_ops is registered/unregistered
 * GLOBAL  - set manualy by ftrace_ops user to denote the ftrace_ops
 *           is part of the global tracers sharing the same filter
 *           via set_ftrace_* debugfs files.
 * DYNAMIC - set when ftrace_ops is registered to denote dynamically
 *           allocated ftrace_ops which need special care
 * CONTROL - set manualy by ftrace_ops user to denote the ftrace_ops
 *           could be controled by following calls:
 *             ftrace_function_local_enable
 *             ftrace_function_local_disable
 * SAVE_REGS - The ftrace_ops wants regs saved at each function called
 *            and passed to the callback. If this flag is set, but the
 *            architecture does not support passing regs
 *            (ARCH_SUPPORTS_FTRACE_SAVE_REGS is not defined), then the
 *            ftrace_ops will fail to register, unless the next flag
 *            is set.
 * SAVE_REGS_IF_SUPPORTED - This is the same as SAVE_REGS, but if the
 *            handler can handle an arch that does not save regs
 *            (the handler tests if regs == NULL), then it can set
 *            this flag instead. It will not fail registering the ftrace_ops
 *            but, the regs field will be NULL if the arch does not support
 *            passing regs to the handler.
 *            Note, if this flag is set, the SAVE_REGS flag will automatically
 *            get set upon registering the ftrace_ops, if the arch supports it.
 * RECURSION_SAFE - The ftrace_ops can set this to tell the ftrace infrastructure
 *            that the call back has its own recursion protection. If it does
 *            not set this, then the ftrace infrastructure will add recursion
 *            protection for the caller.
 */
enum {
	FTRACE_OPS_FL_ENABLED			= 1 << 0,
	FTRACE_OPS_FL_GLOBAL			= 1 << 1,
	FTRACE_OPS_FL_DYNAMIC			= 1 << 2,
	FTRACE_OPS_FL_CONTROL			= 1 << 3,
	FTRACE_OPS_FL_SAVE_REGS			= 1 << 4,
	FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED	= 1 << 5,
	FTRACE_OPS_FL_RECURSION_SAFE		= 1 << 6,
};

struct ftrace_ops {
	ftrace_func_t			func;
	struct ftrace_ops		*next;
	unsigned long			flags;
	int __percpu			*disabled;
#ifdef CONFIG_DYNAMIC_FTRACE
	struct ftrace_hash		*notrace_hash;
	struct ftrace_hash		*filter_hash;
#endif
};

extern int function_trace_stop;

/*
 * Type of the current tracing.
 */
enum ftrace_tracing_type_t {
	FTRACE_TYPE_ENTER = 0, /* Hook the call of the function */
	FTRACE_TYPE_RETURN,	/* Hook the return of the function */
};

/* Current tracing type, default is FTRACE_TYPE_ENTER */
extern enum ftrace_tracing_type_t ftrace_tracing_type;

/**
 * ftrace_stop - stop function tracer.
 *
 * A quick way to stop the function tracer. Note this an on off switch,
 * it is not something that is recursive like preempt_disable.
 * This does not disable the calling of mcount, it only stops the
 * calling of functions from mcount.
 */
static inline void ftrace_stop(void)
{
	function_trace_stop = 1;
}

/**
 * ftrace_start - start the function tracer.
 *
 * This function is the inverse of ftrace_stop. This does not enable
 * the function tracing if the function tracer is disabled. This only
 * sets the function tracer flag to continue calling the functions
 * from mcount.
 */
static inline void ftrace_start(void)
{
	function_trace_stop = 0;
}

/*
 * The ftrace_ops must be a static and should also
 * be read_mostly.  These functions do modify read_mostly variables
 * so use them sparely. Never free an ftrace_op or modify the
 * next pointer after it has been registered. Even after unregistering
 * it, the next pointer may still be used internally.
 */
int register_ftrace_function(struct ftrace_ops *ops);
int unregister_ftrace_function(struct ftrace_ops *ops);
void clear_ftrace_function(void);

/**
 * ftrace_function_local_enable - enable controlled ftrace_ops on current cpu
 *
 * This function enables tracing on current cpu by decreasing
 * the per cpu control variable.
 * It must be called with preemption disabled and only on ftrace_ops
 * registered with FTRACE_OPS_FL_CONTROL. If called without preemption
 * disabled, this_cpu_ptr will complain when CONFIG_DEBUG_PREEMPT is enabled.
 */
static inline void ftrace_function_local_enable(struct ftrace_ops *ops)
{
	if (WARN_ON_ONCE(!(ops->flags & FTRACE_OPS_FL_CONTROL)))
		return;

	(*this_cpu_ptr(ops->disabled))--;
}

/**
 * ftrace_function_local_disable - enable controlled ftrace_ops on current cpu
 *
 * This function enables tracing on current cpu by decreasing
 * the per cpu control variable.
 * It must be called with preemption disabled and only on ftrace_ops
 * registered with FTRACE_OPS_FL_CONTROL. If called without preemption
 * disabled, this_cpu_ptr will complain when CONFIG_DEBUG_PREEMPT is enabled.
 */
static inline void ftrace_function_local_disable(struct ftrace_ops *ops)
{
	if (WARN_ON_ONCE(!(ops->flags & FTRACE_OPS_FL_CONTROL)))
		return;

	(*this_cpu_ptr(ops->disabled))++;
}

/**
 * ftrace_function_local_disabled - returns ftrace_ops disabled value
 *                                  on current cpu
 *
 * This function returns value of ftrace_ops::disabled on current cpu.
 * It must be called with preemption disabled and only on ftrace_ops
 * registered with FTRACE_OPS_FL_CONTROL. If called without preemption
 * disabled, this_cpu_ptr will complain when CONFIG_DEBUG_PREEMPT is enabled.
 */
static inline int ftrace_function_local_disabled(struct ftrace_ops *ops)
{
	WARN_ON_ONCE(!(ops->flags & FTRACE_OPS_FL_CONTROL));
	return *this_cpu_ptr(ops->disabled);
}

extern void ftrace_stub(unsigned long a0, unsigned long a1,
			struct ftrace_ops *op, struct pt_regs *regs);

#else /* !CONFIG_FUNCTION_TRACER */
/*
 * (un)register_ftrace_function must be a macro since the ops parameter
 * must not be evaluated.
 */
#define register_ftrace_function(ops) ({ 0; })
#define unregister_ftrace_function(ops) ({ 0; })
static inline int ftrace_nr_registered_ops(void)
{
	return 0;
}
static inline void clear_ftrace_function(void) { }
static inline void ftrace_kill(void) { }
static inline void ftrace_stop(void) { }
static inline void ftrace_start(void) { }
#endif /* CONFIG_FUNCTION_TRACER */

#ifdef CONFIG_STACK_TRACER
extern int stack_tracer_enabled;
int
stack_trace_sysctl(struct ctl_table *table, int write,
		   void __user *buffer, size_t *lenp,
		   loff_t *ppos);
#endif

struct ftrace_func_command {
	struct list_head	list;
	char			*name;
	int			(*func)(struct ftrace_hash *hash,
					char *func, char *cmd,
					char *params, int enable);
};

#ifdef CONFIG_DYNAMIC_FTRACE

int ftrace_arch_code_modify_prepare(void);
int ftrace_arch_code_modify_post_process(void);

void ftrace_bug(int err, unsigned long ip);

struct seq_file;

struct ftrace_probe_ops {
	void			(*func)(unsigned long ip,
					unsigned long parent_ip,
					void **data);
	int			(*callback)(unsigned long ip, void **data);
	void			(*free)(void **data);
	int			(*print)(struct seq_file *m,
					 unsigned long ip,
					 struct ftrace_probe_ops *ops,
					 void *data);
};

extern int
register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
			      void *data);
extern void
unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
				void *data);
extern void
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
extern void unregister_ftrace_function_probe_all(char *glob);

extern int ftrace_text_reserved(void *start, void *end);

extern int ftrace_nr_registered_ops(void);

/*
 * The dyn_ftrace record's flags field is split into two parts.
 * the first part which is '0-FTRACE_REF_MAX' is a counter of