Changeset 250 for ksyslog/trunk/ksyslog.h
- Timestamp:
- 10/03/13 23:46:37 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ksyslog/trunk/ksyslog.h
r249 r250 72 72 }; 73 73 74 struct ksyslog_stats { 75 u64 write_bytes; 76 u64 write_packets; 77 u64 drop_bytes; 78 u64 drop_packets; 79 u64 discard_bytes; 80 u64 discard_packets; 81 struct u64_stats_sync sync; 82 }; 83 74 84 struct ksyslog_queue { 75 85 struct list_head head; 76 86 spinlock_t lock; 77 atomic64_t nr_queued; 78 atomic64_t nr_written; 79 atomic64_t nr_dropped; 80 }; 87 atomic64_t size; 88 struct ksyslog_stats __percpu *stats; 89 }; 90 91 static inline void 92 ksyslog_stats_add_write(struct ksyslog_queue *queue, unsigned int len) 93 { 94 struct ksyslog_stats *stats; 95 96 stats = per_cpu_ptr(queue->stats, smp_processor_id()); 97 u64_stats_update_begin(&stats->sync); 98 stats->write_bytes += len; 99 stats->write_packets++; 100 u64_stats_update_end(&stats->sync); 101 } 102 103 static inline void 104 ksyslog_stats_add_drop(struct ksyslog_queue *queue, unsigned int len) 105 { 106 struct ksyslog_stats *stats; 107 108 stats = per_cpu_ptr(queue->stats, smp_processor_id()); 109 u64_stats_update_begin(&stats->sync); 110 stats->drop_bytes += len; 111 stats->drop_packets++; 112 u64_stats_update_end(&stats->sync); 113 } 114 115 static inline void 116 ksyslog_stats_add_discard(struct ksyslog_queue *queue, unsigned int len) 117 { 118 struct ksyslog_stats *stats; 119 120 stats = per_cpu_ptr(queue->stats, smp_processor_id()); 121 u64_stats_update_begin(&stats->sync); 122 stats->discard_bytes += len; 123 stats->discard_packets++; 124 u64_stats_update_end(&stats->sync); 125 } 81 126 82 127 static inline const char *
Note: See TracChangeset
for help on using the changeset viewer.