@@ -448,6 +448,10 @@ static umf_result_t file_alloc(void *provider, size_t size, size_t alignment,
448
448
addr , alloc_offset_fd );
449
449
}
450
450
451
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
452
+ "offset=%zu)" ,
453
+ addr , alloc_offset_fd );
454
+
451
455
* resultPtr = addr ;
452
456
453
457
return UMF_RESULT_SUCCESS ;
@@ -552,23 +556,31 @@ static umf_result_t file_allocation_split(void *provider, void *ptr,
552
556
553
557
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
554
558
if (value == NULL ) {
555
- LOG_ERR ("file_allocation_split(): getting a value from the file "
556
- "descriptor offset map failed (addr=%p)" ,
559
+ LOG_ERR ("getting a value from the file descriptor offset map failed "
560
+ "(addr=%p)" ,
557
561
ptr );
558
562
return UMF_RESULT_ERROR_UNKNOWN ;
559
563
}
560
564
565
+ LOG_DEBUG ("split the value from the file descriptor offset map (addr=%p) "
566
+ "from size %zu to %zu + %zu" ,
567
+ ptr , totalSize , firstSize , totalSize - firstSize );
568
+
561
569
uintptr_t new_key = (uintptr_t )ptr + firstSize ;
562
570
void * new_value = (void * )((uintptr_t )value + firstSize );
563
571
int ret = critnib_insert (file_provider -> fd_offset_map , new_key , new_value ,
564
572
0 /* update */ );
565
573
if (ret ) {
566
- LOG_ERR ("file_allocation_split(): inserting a value to the file "
567
- "descriptor offset map failed (addr=%p, offset=%zu)" ,
574
+ LOG_ERR ("inserting a value to the file descriptor offset map failed "
575
+ "(addr=%p, offset=%zu)" ,
568
576
(void * )new_key , (size_t )new_value - 1 );
569
577
return UMF_RESULT_ERROR_UNKNOWN ;
570
578
}
571
579
580
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
581
+ "offset=%zu)" ,
582
+ (void * )new_key , (size_t )new_value - 1 );
583
+
572
584
return UMF_RESULT_SUCCESS ;
573
585
}
574
586
@@ -586,12 +598,16 @@ static umf_result_t file_allocation_merge(void *provider, void *lowPtr,
586
598
void * value =
587
599
critnib_remove (file_provider -> fd_offset_map , (uintptr_t )highPtr );
588
600
if (value == NULL ) {
589
- LOG_ERR ("file_allocation_merge(): removing a value from the file "
590
- "descriptor offset map failed (addr=%p)" ,
601
+ LOG_ERR ("removing a value from the file descriptor offset map failed "
602
+ "(addr=%p)" ,
591
603
highPtr );
592
604
return UMF_RESULT_ERROR_UNKNOWN ;
593
605
}
594
606
607
+ LOG_DEBUG ("removed a value from the file descriptor offset map (addr=%p) - "
608
+ "merged with %p" ,
609
+ highPtr , lowPtr );
610
+
595
611
return UMF_RESULT_SUCCESS ;
596
612
}
597
613
@@ -633,9 +649,7 @@ static umf_result_t file_get_ipc_handle(void *provider, const void *ptr,
633
649
634
650
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
635
651
if (value == NULL ) {
636
- LOG_ERR ("file_get_ipc_handle(): getting a value from the IPC cache "
637
- "failed (addr=%p)" ,
638
- ptr );
652
+ LOG_ERR ("getting a value from the IPC cache failed (addr=%p)" , ptr );
639
653
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
640
654
}
641
655
0 commit comments