@@ -476,6 +476,10 @@ static umf_result_t file_alloc_cb(void *provider, size_t size, size_t alignment,
476
476
addr , alloc_offset_fd );
477
477
}
478
478
479
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
480
+ "offset=%zu)" ,
481
+ addr , alloc_offset_fd );
482
+
479
483
* resultPtr = addr ;
480
484
481
485
return UMF_RESULT_SUCCESS ;
@@ -580,23 +584,31 @@ static umf_result_t file_allocation_split_cb(void *provider, void *ptr,
580
584
581
585
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
582
586
if (value == NULL ) {
583
- LOG_ERR ("file_allocation_split(): getting a value from the file "
584
- "descriptor offset map failed (addr=%p)" ,
587
+ LOG_ERR ("getting a value from the file descriptor offset map failed "
588
+ "(addr=%p)" ,
585
589
ptr );
586
590
return UMF_RESULT_ERROR_UNKNOWN ;
587
591
}
588
592
593
+ LOG_DEBUG ("split the value from the file descriptor offset map (addr=%p) "
594
+ "from size %zu to %zu + %zu" ,
595
+ ptr , totalSize , firstSize , totalSize - firstSize );
596
+
589
597
uintptr_t new_key = (uintptr_t )ptr + firstSize ;
590
598
void * new_value = (void * )((uintptr_t )value + firstSize );
591
599
int ret = critnib_insert (file_provider -> fd_offset_map , new_key , new_value ,
592
600
0 /* update */ );
593
601
if (ret ) {
594
- LOG_ERR ("file_allocation_split(): inserting a value to the file "
595
- "descriptor offset map failed (addr=%p, offset=%zu)" ,
602
+ LOG_ERR ("inserting a value to the file descriptor offset map failed "
603
+ "(addr=%p, offset=%zu)" ,
596
604
(void * )new_key , (size_t )new_value - 1 );
597
605
return UMF_RESULT_ERROR_UNKNOWN ;
598
606
}
599
607
608
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
609
+ "offset=%zu)" ,
610
+ (void * )new_key , (size_t )new_value - 1 );
611
+
600
612
return UMF_RESULT_SUCCESS ;
601
613
}
602
614
@@ -619,12 +631,16 @@ static umf_result_t file_allocation_merge_cb(void *provider, void *lowPtr,
619
631
void * value =
620
632
critnib_remove (file_provider -> fd_offset_map , (uintptr_t )highPtr );
621
633
if (value == NULL ) {
622
- LOG_ERR ("file_allocation_merge(): removing a value from the file "
623
- "descriptor offset map failed (addr=%p)" ,
634
+ LOG_ERR ("removing a value from the file descriptor offset map failed "
635
+ "(addr=%p)" ,
624
636
highPtr );
625
637
return UMF_RESULT_ERROR_UNKNOWN ;
626
638
}
627
639
640
+ LOG_DEBUG ("removed a value from the file descriptor offset map (addr=%p) - "
641
+ "merged with %p" ,
642
+ highPtr , lowPtr );
643
+
628
644
return UMF_RESULT_SUCCESS ;
629
645
}
630
646
@@ -658,9 +674,7 @@ static umf_result_t file_get_ipc_handle(void *provider, const void *ptr,
658
674
659
675
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
660
676
if (value == NULL ) {
661
- LOG_ERR ("file_get_ipc_handle(): getting a value from the IPC cache "
662
- "failed (addr=%p)" ,
663
- ptr );
677
+ LOG_ERR ("getting a value from the IPC cache failed (addr=%p)" , ptr );
664
678
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
665
679
}
666
680
0 commit comments