45
45
static void update_pages_handler (struct work_struct * work );
46
46
47
47
struct ring_buffer_meta {
48
+ unsigned long text_addr ;
49
+ unsigned long data_addr ;
48
50
unsigned long first_buffer ;
49
51
unsigned long head_buffer ;
50
52
unsigned long commit_buffer ;
@@ -542,6 +544,9 @@ struct trace_buffer {
542
544
unsigned long range_addr_start ;
543
545
unsigned long range_addr_end ;
544
546
547
+ long last_text_delta ;
548
+ long last_data_delta ;
549
+
545
550
unsigned int subbuf_size ;
546
551
unsigned int subbuf_order ;
547
552
unsigned int max_data_size ;
@@ -1821,10 +1826,15 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer)
1821
1826
}
1822
1827
}
1823
1828
1829
+ /* Used to calculate data delta */
1830
+ static char rb_data_ptr [] = "" ;
1831
+
1824
1832
static void rb_range_meta_init (struct trace_buffer * buffer , int nr_pages )
1825
1833
{
1826
1834
struct ring_buffer_meta * meta ;
1827
1835
unsigned long delta ;
1836
+ unsigned long this_text = (unsigned long )rb_range_meta_init ;
1837
+ unsigned long this_data = (unsigned long )rb_data_ptr ;
1828
1838
void * subbuf ;
1829
1839
int cpu ;
1830
1840
int i ;
@@ -1841,6 +1851,10 @@ static void rb_range_meta_init(struct trace_buffer *buffer, int nr_pages)
1841
1851
meta -> first_buffer += delta ;
1842
1852
meta -> head_buffer += delta ;
1843
1853
meta -> commit_buffer += delta ;
1854
+ buffer -> last_text_delta = this_text - meta -> text_addr ;
1855
+ buffer -> last_data_delta = this_data - meta -> data_addr ;
1856
+ meta -> text_addr = this_text ;
1857
+ meta -> data_addr = this_data ;
1844
1858
continue ;
1845
1859
}
1846
1860
@@ -1857,6 +1871,8 @@ static void rb_range_meta_init(struct trace_buffer *buffer, int nr_pages)
1857
1871
subbuf = rb_subbufs_from_meta (meta );
1858
1872
1859
1873
meta -> first_buffer = (unsigned long )subbuf ;
1874
+ meta -> text_addr = this_text ;
1875
+ meta -> data_addr = this_data ;
1860
1876
1861
1877
/*
1862
1878
* The buffers[] array holds the order of the sub-buffers
0 commit comments