Lines Matching defs:msp

2254 static void ms_sort(struct ms_stream *msp);
2255 static int ms_prime(struct ms_stream *msp);
2257 static inline struct trace *ms_peek(struct ms_stream *msp)
2259 return (msp == NULL) ? NULL : msp->first;
2262 static inline __u64 ms_peek_time(struct ms_stream *msp)
2264 return ms_peek(msp)->bit->time;
2267 static inline void ms_resort(struct ms_stream *msp)
2269 if (msp->next && ms_peek_time(msp) > ms_peek_time(msp->next)) {
2270 ms_head = msp->next;
2271 msp->next = NULL;
2272 ms_sort(msp);
2276 static inline void ms_deq(struct ms_stream *msp)
2278 msp->first = msp->first->next;
2279 if (!msp->first) {
2280 msp->last = NULL;
2281 if (!ms_prime(msp)) {
2282 ms_head = msp->next;
2283 msp->next = NULL;
2288 ms_resort(msp);
2291 static void ms_sort(struct ms_stream *msp)
2293 __u64 msp_t = ms_peek_time(msp);
2297 ms_head = msp;
2299 msp->next = this_msp;
2300 ms_head = msp;
2306 msp->next = this_msp->next;
2307 this_msp->next = msp;
2311 static int ms_prime(struct ms_stream *msp)
2316 struct per_dev_info *pdi = msp->pdi;
2317 struct per_cpu_info *pci = get_cpu_info(pdi, msp->cpu);
2371 if (msp->first == NULL)
2372 msp->first = msp->last = t;
2374 msp->last->next = t;
2375 msp->last = t;
2395 struct ms_stream *msp = malloc(sizeof(*msp));
2397 msp->next = NULL;
2398 msp->first = msp->last = NULL;
2399 msp->pdi = pdi;
2400 msp->cpu = cpu;
2402 if (ms_prime(msp))
2403 ms_sort(msp);
2405 return msp;
2452 static int handle(struct ms_stream *msp)
2459 t = ms_peek(msp);
2462 pdi = msp->pdi;
2463 pci = get_cpu_info(pdi, msp->cpu);
2475 ms_deq(msp);