@@ -519,6 +519,10 @@ static umf_result_t file_alloc_cb(void *provider, size_t size, size_t alignment,
519
519
addr , alloc_offset_fd );
520
520
}
521
521
522
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
523
+ "offset=%zu)" ,
524
+ addr , alloc_offset_fd );
525
+
522
526
* resultPtr = addr ;
523
527
524
528
return UMF_RESULT_SUCCESS ;
@@ -623,23 +627,31 @@ static umf_result_t file_allocation_split_cb(void *provider, void *ptr,
623
627
624
628
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
625
629
if (value == NULL ) {
626
- LOG_ERR ("file_allocation_split(): getting a value from the file "
627
- "descriptor offset map failed (addr=%p)" ,
630
+ LOG_ERR ("getting a value from the file descriptor offset map failed "
631
+ "(addr=%p)" ,
628
632
ptr );
629
633
return UMF_RESULT_ERROR_UNKNOWN ;
630
634
}
631
635
636
+ LOG_DEBUG ("split the value from the file descriptor offset map (addr=%p) "
637
+ "from size %zu to %zu + %zu" ,
638
+ ptr , totalSize , firstSize , totalSize - firstSize );
639
+
632
640
uintptr_t new_key = (uintptr_t )ptr + firstSize ;
633
641
void * new_value = (void * )((uintptr_t )value + firstSize );
634
642
int ret = critnib_insert (file_provider -> fd_offset_map , new_key , new_value ,
635
643
0 /* update */ );
636
644
if (ret ) {
637
- LOG_ERR ("file_allocation_split(): inserting a value to the file "
638
- "descriptor offset map failed (addr=%p, offset=%zu)" ,
645
+ LOG_ERR ("inserting a value to the file descriptor offset map failed "
646
+ "(addr=%p, offset=%zu)" ,
639
647
(void * )new_key , (size_t )new_value - 1 );
640
648
return UMF_RESULT_ERROR_UNKNOWN ;
641
649
}
642
650
651
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
652
+ "offset=%zu)" ,
653
+ (void * )new_key , (size_t )new_value - 1 );
654
+
643
655
return UMF_RESULT_SUCCESS ;
644
656
}
645
657
@@ -662,12 +674,16 @@ static umf_result_t file_allocation_merge_cb(void *provider, void *lowPtr,
662
674
void * value =
663
675
critnib_remove (file_provider -> fd_offset_map , (uintptr_t )highPtr );
664
676
if (value == NULL ) {
665
- LOG_ERR ("file_allocation_merge(): removing a value from the file "
666
- "descriptor offset map failed (addr=%p)" ,
677
+ LOG_ERR ("removing a value from the file descriptor offset map failed "
678
+ "(addr=%p)" ,
667
679
highPtr );
668
680
return UMF_RESULT_ERROR_UNKNOWN ;
669
681
}
670
682
683
+ LOG_DEBUG ("removed a value from the file descriptor offset map (addr=%p) - "
684
+ "merged with %p" ,
685
+ highPtr , lowPtr );
686
+
671
687
return UMF_RESULT_SUCCESS ;
672
688
}
673
689
@@ -701,9 +717,7 @@ static umf_result_t file_get_ipc_handle(void *provider, const void *ptr,
701
717
702
718
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
703
719
if (value == NULL ) {
704
- LOG_ERR ("file_get_ipc_handle(): getting a value from the IPC cache "
705
- "failed (addr=%p)" ,
706
- ptr );
720
+ LOG_ERR ("getting a value from the IPC cache failed (addr=%p)" , ptr );
707
721
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
708
722
}
709
723
0 commit comments