---
 kernel/trace/latency_hist.c |   36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

Index: linux-2.6.33.7-rt29/kernel/trace/latency_hist.c
===================================================================
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:100 @ struct maxlatproc_data {
 	int pid;
 	int prio;
 	long latency;
+	long timeroffset;
 };
 #endif
 
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:151 @ static DEFINE_PER_CPU(struct maxlatproc_
 #endif
 
 void notrace latency_hist(int latency_type, int cpu, unsigned long latency,
-			  struct task_struct *p)
+			  unsigned long timeroffset, struct task_struct *p)
 {
 	struct hist_data *my_hist;
 #if defined(CONFIG_WAKEUP_LATENCY_HIST) || \
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:233 @ void notrace latency_hist(int latency_ty
 			mp->pid = task_pid_nr(p);
 			mp->prio = p->prio;
 			mp->latency = latency;
+			mp->timeroffset = timeroffset;
 		}
 #endif
 		my_hist->max_lat = latency;
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:427 @ latency_hist_reset(struct file *file, co
 		    latency_type == MISSED_TIMER_OFFSETS ||
 		    latency_type == TIMERANDWAKEUP_LATENCY) {
 			mp->comm[0] = '\0';
-			mp->prio = mp->pid = mp->latency = -1;
+			mp->prio = mp->pid = mp->latency = mp->timeroffset = -1;
 		}
 #endif
 	}
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:485 @ show_maxlatproc(struct file *file, char 
 	if (buf == NULL)
 		return -ENOMEM;
 
-	r = snprintf(buf, strmaxlen, "%d %d %ld %s\n",
-	    mp->pid, MAX_RT_PRIO-1 - mp->prio, mp->latency, mp->comm);
+	r = snprintf(buf, strmaxlen, "%d %d %ld (%ld) %s\n",
+	    mp->pid, MAX_RT_PRIO-1 - mp->prio, mp->latency, mp->timeroffset,
+	    mp->comm);
 	r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
 	kfree(buf);
 	return r;
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:761 @ static notrace void probe_preemptirqsoff
 				unsigned long latency =
 				    nsecs_to_usecs(stop - start);
 
-				latency_hist(IRQSOFF_LATENCY, cpu, latency,
+				latency_hist(IRQSOFF_LATENCY, cpu, latency, 0,
 				    NULL);
 			}
 			per_cpu(hist_irqsoff_counting, cpu) = 0;
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:780 @ static notrace void probe_preemptirqsoff
 				    nsecs_to_usecs(stop - start);
 
 				latency_hist(PREEMPTOFF_LATENCY, cpu, latency,
-				    NULL);
+				    0, NULL);
 			}
 			per_cpu(hist_preemptoff_counting, cpu) = 0;
 		}
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:798 @ static notrace void probe_preemptirqsoff
 				unsigned long latency =
 				    nsecs_to_usecs(stop - start);
 				latency_hist(PREEMPTIRQSOFF_LATENCY, cpu,
-				    latency, NULL);
+				    latency, 0, NULL);
 			}
 			per_cpu(hist_preemptirqsoff_counting, cpu) = 0;
 		}
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:908 @ static notrace void probe_wakeup_latency
 	latency = nsecs_to_usecs(stop - next->preempt_timestamp_hist);
 
 	if (per_cpu(wakeup_sharedprio, cpu)) {
-		latency_hist(WAKEUP_LATENCY_SHAREDPRIO, cpu, latency, next);
+		latency_hist(WAKEUP_LATENCY_SHAREDPRIO, cpu, latency, 0, next);
 		per_cpu(wakeup_sharedprio, cpu) = 0;
 	} else {
-		latency_hist(WAKEUP_LATENCY, cpu, latency, next);
+		latency_hist(WAKEUP_LATENCY, cpu, latency, 0, next);
 #ifdef CONFIG_MISSED_TIMER_OFFSETS_HIST
 		if (timerandwakeup_enabled_data.enabled) {
 			latency_hist(TIMERANDWAKEUP_LATENCY, cpu,
-			    next->timer_offset + latency, next);
+			    next->timer_offset + latency, next->timer_offset,
+			    next);
 		}
 #endif
 	}
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:939 @ static notrace void probe_hrtimer_interr
 	if (latency_ns <= 0 && task != NULL && rt_task(task) &&
 	    (task->prio < curr->prio ||
 	    (task->prio == curr->prio &&
-	    !test_cpu_mask(cpu, &task->cpus_allowed)))) {
+	    !cpumask_test_cpu(cpu, &task->cpus_allowed)))) {
 		unsigned long latency;
 
 		if (missed_timer_offsets_pid) {
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:949 @ static notrace void probe_hrtimer_interr
 		}
 
 		latency = (unsigned long) div_s64(-latency_ns, 1000);
-		latency_hist(MISSED_TIMER_OFFSETS, cpu, latency, task);
+		latency_hist(MISSED_TIMER_OFFSETS, cpu, latency, latency, task);
 #ifdef CONFIG_WAKEUP_LATENCY_HIST
 		task->timer_offset = latency;
 #endif
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:1057 @ static __init int latency_hist_init(void
 		mp = &per_cpu(wakeup_maxlatproc, i);
 		entry = debugfs_create_file(name, 0444, dentry, mp,
 		    &maxlatproc_fops);
-		mp->prio = mp->pid = mp->latency = -1;
+		mp->prio = mp->pid = mp->latency = mp->timeroffset = -1;
 
 		mp = &per_cpu(wakeup_maxlatproc_sharedprio, i);
 		entry = debugfs_create_file(name, 0444, dentry_sharedprio, mp,
 		    &maxlatproc_fops);
-		mp->prio = mp->pid = mp->latency = -1;
+		mp->prio = mp->pid = mp->latency = mp->timeroffset = -1;
 	}
 	entry = debugfs_create_file("pid", 0644, dentry,
 	    (void *)&wakeup_pid, &pid_fops);
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:1090 @ static __init int latency_hist_init(void
 		mp = &per_cpu(missed_timer_offsets_maxlatproc, i);
 		entry = debugfs_create_file(name, 0444, dentry, mp,
 		    &maxlatproc_fops);
-		mp->prio = mp->pid = mp->latency = -1;
+		mp->prio = mp->pid = mp->latency = mp->timeroffset = -1;
 	}
 	entry = debugfs_create_file("pid", 0644, dentry,
 	    (void *)&missed_timer_offsets_pid, &pid_fops);
@ linux-2.6.33.7-rt29/kernel/trace/latency_hist.c:1118 @ static __init int latency_hist_init(void
 		mp = &per_cpu(timerandwakeup_maxlatproc, i);
 		entry = debugfs_create_file(name, 0444, dentry, mp,
 		    &maxlatproc_fops);
-		mp->prio = mp->pid = mp->latency = -1;
+		mp->prio = mp->pid = mp->latency = mp->timeroffset = -1;
 	}
 	entry = debugfs_create_file("reset", 0644, dentry,
 	    (void *)TIMERANDWAKEUP_LATENCY, &latency_hist_reset_fops);