aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/net_dropmonitor.py
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-23 20:10:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-23 20:10:14 -0400
commit07d9a380680d1c0eb51ef87ff2eab5c994949e69 (patch)
treed93f1c132798f5c01e6bb8ac96170dccacb2d393 /tools/perf/scripts/python/net_dropmonitor.py
parent5ff93abc7a2aff167a91bf4ccd47bd0789f86fc0 (diff)
Linux 4.9-rc2
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions
5f8a45c16475'>5c113fbeed7
1da177e4c3f
e3920fb42c8




79a6cdeb7eb

d221938c049







31950eb66ff




d221938c049
86ef5c9a8ed
a9d9baa1e81
d221938c049

aa953877740
d221938c049



a9d9baa1e81
86ef5c9a8ed
90d45d17f3e
86ef5c9a8ed
a9d9baa1e81
d221938c049
aa953877740
d221938c049
d2ba7e2ae20

d221938c049

a9d9baa1e81
86ef5c9a8ed
a9d9baa1e81
d221938c049






d2ba7e2ae20

d221938c049









86ef5c9a8ed
d221938c049



d221938c049
d2ba7e2ae20





d221938c049

d221938c049
d221938c049






79a6cdeb7eb





1da177e4c3f
f7b16c108fd
1da177e4c3f
bd5349cfd2b
d221938c049
bd5349cfd2b
d221938c049
bd5349cfd2b
1da177e4c3f
65edc68c345
e9fb7631ebc


e6bde73b07e


e9fb7631ebc
e6bde73b07e

e9fb7631ebc






00b9b0af588

e9fb7631ebc

00b9b0af588
e9fb7631ebc

1da177e4c3f

9647155ffbc
1da177e4c3f
d221938c049
bd5349cfd2b
d221938c049
1da177e4c3f


1da177e4c3f





11854247e2c
1da177e4c3f

9d3cfc4c1d1



1da177e4c3f



db912f96390




1da177e4c3f
514a20a5da9
1da177e4c3f
db912f96390
1da177e4c3f

1da177e4c3f


f3705136404
1da177e4c3f
e9fb7631ebc
3ba35573ad9
f3705136404
1da177e4c3f

e3920fb42c8
514a20a5da9
1da177e4c3f
e7407dcc69e
e7407dcc69e
8bb7844286f
db912f96390



1da177e4c3f
e3920fb42c8

1da177e4c3f
e3920fb42c8

1da177e4c3f
d221938c049
e9fb7631ebc
e6bde73b07e
a0d8cdb652d
e9fb7631ebc
1da177e4c3f
af1f16d08f3
baaca49f415
1da177e4c3f

e0b582ec56f
04321587584
1da177e4c3f
e9fb7631ebc
1da177e4c3f
6a1bdc1b577
8fa1d7d3b2c
04321587584
1da177e4c3f
48c5ccae88d



51a96c77815

48c5ccae88d
51a96c77815

1da177e4c3f



1da177e4c3f
e9fb7631ebc
1da177e4c3f


baaca49f415
d221938c049
e9fb7631ebc

e3920fb42c8


514a20a5da9
e3920fb42c8
9ea09af3bd3
e3920fb42c8
d221938c049
e761b772523

e3920fb42c8
e761b772523


e761b772523
e3920fb42c8
e761b772523
d221938c049
1da177e4c3f

b62b8ef906c
1da177e4c3f

e3920fb42c8
8bb7844286f
1da177e4c3f
baaca49f415
1da177e4c3f
8bb7844286f
1da177e4c3f
e3920fb42c8

90d45d17f3e
d221938c049
e9fb7631ebc
e6bde73b07e
a0d8cdb652d
1da177e4c3f
af1f16d08f3
1da177e4c3f






6978c7052f2
1da177e4c3f

e9fb7631ebc
1da177e4c3f


e9fb7631ebc
d221938c049
e3920fb42c8



b282b6f8a8d
e3920fb42c8

cf23422b9d7





e0b582ec56f
73e753a50dc

87d5e0236d9
73e753a50dc




e3920fb42c8
cf23422b9d7














4eaf3f64397

1f522509c77
4eaf3f64397

cf23422b9d7

d221938c049
e761b772523

e3920fb42c8
e761b772523




e761b772523
d221938c049
e3920fb42c8


f3de4be9d5f
e0b582ec56f
e3920fb42c8
3fb82d56ad0







e3920fb42c8

e9a5f426b85
e3920fb42c8
d221938c049
e0b582ec56f
9ee349ad6d3

e3920fb42c8

e0b582ec56f
3fb82d56ad0
6ad4c18884e
e3920fb42c8



8bb7844286f
feae3203d71
e0b582ec56f
feae3203d71
e3920fb42c8




86886e55b27
3fb82d56ad0

e3920fb42c8




e1d9fd2e3d3
e3920fb42c8
d221938c049
e3920fb42c8


d0af9eed5aa







fa7303e22c8
e3920fb42c8



d221938c049
e3920fb42c8
e0b582ec56f
1d64b9cb1dc
e3920fb42c8

d0af9eed5aa


e0b582ec56f
8bb7844286f
e3920fb42c8



1d64b9cb1dc
e3920fb42c8
d0af9eed5aa


e0b582ec56f
1d64b9cb1dc
d221938c049
1da177e4c3f
e0b582ec56f







f3de4be9d5f
68f4f1ec08e
e545a6140b6







8419641450e
e545a6140b6



e0b582ec56f
e545a6140b6

e9fb7631ebc
e545a6140b6

68f4f1ec08e
b8d317d10cc
e56b3bc7942



e0b582ec56f
e56b3bc7942

b8d317d10cc
e56b3bc7942




b8d317d10cc
e56b3bc7942






b8d317d10cc

e56b3bc7942
2d3854a37e8


b3199c025d1




















3fa41520696














































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














                                           
                        
                      
 
                 
                                                                 
                                         
 













                                                                 
                                    
 




                                                                 

                         







                                                                   




                                                      
 
                          
 

                                                 
                       



                                        
 
                                   
 
                          
 
                                                 
                       
                                      

                                                                           

                                        
 
                                   
 






                                                                     

                                                                          









                                                                 
                                                               



                                   
                                            





                                                          

                                                
         






                                         





                                          
                                            
                                                          
 
                
                                
                                                          
                               
                   
 
 


                                                                   


                                                                       
                                                  

                                      






                                                 

                         

                                                         
                                   

 

                                     
                                                             
 
                                
                                                      
                               


                                       





                                           
                                                                     

                                                           



                                                                              



                                         




                            
                         
                                            
 
                                                   

                


                                                                 
                           
 
                                                        
 
                 

 
                                             
                                                              
 
                              
                                       
                                                                



                                                
 

                                   
 

                               
 
                            
                                                                        
                  
                           
                                                                          
                                                                  
                                               
                                 

         
                                                                         
                  
                                                                     
                                                               
 
                                 
         
                                
 



                                                                           

                                               
           

                              



                                          
                                                                           
                                                


                             
            
                           

                                                             


                   
                                    
 
                
 
                                

                                   
                             


                         
                                
 
    
                               

                   
                        

                             
                                             
                                                                
 
                              
                                       
                                                                
 

                                                 
 
                            
                                                                      
                  
                           
                                                                 
                                               






                                          
                                 

                                               
                                           


                     
                                                                          
                           



                   
                                      

                    





                               
                                 

                                                                        
                        




                                                                     
 














                                                                        

                                                             
                                          

                                               

      
                                

                                   
                             




                              
    
                               


                   
                          
                                 
 







                                                 

                              
                                      
 
                                
                                                   

                                                                           

                                                                            
                                   
                                          
 



                                                
                                          
                           
                                                          
                      




                                                                        
 

                                        




                                                                         
                                                                    
         
                               


                     







                                                
                                    



                                                         
                                
                                 
                                       
                         

                                               


                                         
                                        
                                        



                                                     
                                                                               
         


                                       
                                   
    
                               
 







                                                                    
                                
 







                                                                        
                                                    



                                         
                                                                      

                                          
                                           

 
                       
 



                                                                  
                                                                

                                             
 




                                                                      
 






                                                                               

      
                                  


                                                           




















                                                                              














































                                                                      
/* CPU control.
 * (C) 2001, 2002, 2003, 2004 Rusty Russell
 *
 * This code is licenced under the GPL.
 */
#include <linux/proc_fs.h>
#include <linux/smp.h>
#include <linux/init.h>
#include <linux/notifier.h>
#include <linux/sched.h>
#include <linux/unistd.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/stop_machine.h>
#include <linux/mutex.h>
#include <linux/gfp.h>

#ifdef CONFIG_SMP
/* Serializes the updates to cpu_online_mask, cpu_present_mask */
static DEFINE_MUTEX(cpu_add_remove_lock);

/*
 * The following two API's must be used when attempting
 * to serialize the updates to cpu_online_mask, cpu_present_mask.
 */
void cpu_maps_update_begin(void)
{
	mutex_lock(&cpu_add_remove_lock);
}

void cpu_maps_update_done(void)
{
	mutex_unlock(&cpu_add_remove_lock);
}

static RAW_NOTIFIER_HEAD(cpu_chain);

/* If set, cpu_up and cpu_down will return -EBUSY and do nothing.
 * Should always be manipulated under cpu_add_remove_lock
 */
static int cpu_hotplug_disabled;

#ifdef CONFIG_HOTPLUG_CPU

static struct {
	struct task_struct *active_writer;
	struct mutex lock; /* Synchronizes accesses to refcount, */
	/*
	 * Also blocks the new readers during
	 * an ongoing cpu hotplug operation.
	 */
	int refcount;
} cpu_hotplug = {
	.active_writer = NULL,
	.lock = __MUTEX_INITIALIZER(cpu_hotplug.lock),
	.refcount = 0,
};

void get_online_cpus(void)
{
	might_sleep();
	if (cpu_hotplug.active_writer == current)
		return;
	mutex_lock(&cpu_hotplug.lock);
	cpu_hotplug.refcount++;
	mutex_unlock(&cpu_hotplug.lock);

}
EXPORT_SYMBOL_GPL(get_online_cpus);

void put_online_cpus(void)
{
	if (cpu_hotplug.active_writer == current)
		return;
	mutex_lock(&cpu_hotplug.lock);
	if (!--cpu_hotplug.refcount && unlikely(cpu_hotplug.active_writer))
		wake_up_process(cpu_hotplug.active_writer);
	mutex_unlock(&cpu_hotplug.lock);

}
EXPORT_SYMBOL_GPL(put_online_cpus);

/*
 * This ensures that the hotplug operation can begin only when the
 * refcount goes to zero.
 *
 * Note that during a cpu-hotplug operation, the new readers, if any,
 * will be blocked by the cpu_hotplug.lock
 *
 * Since cpu_hotplug_begin() is always called after invoking
 * cpu_maps_update_begin(), we can be sure that only one writer is active.
 *
 * Note that theoretically, there is a possibility of a livelock:
 * - Refcount goes to zero, last reader wakes up the sleeping
 *   writer.
 * - Last reader unlocks the cpu_hotplug.lock.
 * - A new reader arrives at this moment, bumps up the refcount.
 * - The writer acquires the cpu_hotplug.lock finds the refcount
 *   non zero and goes to sleep again.
 *
 * However, this is very difficult to achieve in practice since
 * get_online_cpus() not an api which is called all that often.
 *
 */
static void cpu_hotplug_begin(void)
{
	cpu_hotplug.active_writer = current;

	for (;;) {
		mutex_lock(&cpu_hotplug.lock);
		if (likely(!cpu_hotplug.refcount))
			break;
		__set_current_state(TASK_UNINTERRUPTIBLE);
		mutex_unlock(&cpu_hotplug.lock);
		schedule();
	}
}

static void cpu_hotplug_done(void)
{
	cpu_hotplug.active_writer = NULL;
	mutex_unlock(&cpu_hotplug.lock);
}

#else /* #if CONFIG_HOTPLUG_CPU */
static void cpu_hotplug_begin(void) {}
static void cpu_hotplug_done(void) {}
#endif	/* #esle #if CONFIG_HOTPLUG_CPU */

/* Need to know about CPUs going up/down? */
int __ref register_cpu_notifier(struct notifier_block *nb)