@@ -439,6 +439,10 @@ static umf_result_t file_alloc(void *provider, size_t size, size_t alignment,
439
439
addr , alloc_offset_fd );
440
440
}
441
441
442
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
443
+ "offset=%zu)" ,
444
+ addr , alloc_offset_fd );
445
+
442
446
* resultPtr = addr ;
443
447
444
448
return UMF_RESULT_SUCCESS ;
@@ -538,23 +542,31 @@ static umf_result_t file_allocation_split(void *provider, void *ptr,
538
542
539
543
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
540
544
if (value == NULL ) {
541
- LOG_ERR ("file_allocation_split(): getting a value from the file "
542
- "descriptor offset map failed (addr=%p)" ,
545
+ LOG_ERR ("getting a value from the file descriptor offset map failed "
546
+ "(addr=%p)" ,
543
547
ptr );
544
548
return UMF_RESULT_ERROR_UNKNOWN ;
545
549
}
546
550
551
+ LOG_DEBUG ("split the value from the file descriptor offset map (addr=%p) "
552
+ "from size %zu to %zu + %zu" ,
553
+ ptr , totalSize , firstSize , totalSize - firstSize );
554
+
547
555
uintptr_t new_key = (uintptr_t )ptr + firstSize ;
548
556
void * new_value = (void * )((uintptr_t )value + firstSize );
549
557
int ret = critnib_insert (file_provider -> fd_offset_map , new_key , new_value ,
550
558
0 /* update */ );
551
559
if (ret ) {
552
- LOG_ERR ("file_allocation_split(): inserting a value to the file "
553
- "descriptor offset map failed (addr=%p, offset=%zu)" ,
560
+ LOG_ERR ("inserting a value to the file descriptor offset map failed "
561
+ "(addr=%p, offset=%zu)" ,
554
562
(void * )new_key , (size_t )new_value - 1 );
555
563
return UMF_RESULT_ERROR_UNKNOWN ;
556
564
}
557
565
566
+ LOG_DEBUG ("inserted a value to the file descriptor offset map (addr=%p, "
567
+ "offset=%zu)" ,
568
+ (void * )new_key , (size_t )new_value - 1 );
569
+
558
570
return UMF_RESULT_SUCCESS ;
559
571
}
560
572
@@ -572,12 +584,16 @@ static umf_result_t file_allocation_merge(void *provider, void *lowPtr,
572
584
void * value =
573
585
critnib_remove (file_provider -> fd_offset_map , (uintptr_t )highPtr );
574
586
if (value == NULL ) {
575
- LOG_ERR ("file_allocation_merge(): removing a value from the file "
576
- "descriptor offset map failed (addr=%p)" ,
587
+ LOG_ERR ("removing a value from the file descriptor offset map failed "
588
+ "(addr=%p)" ,
577
589
highPtr );
578
590
return UMF_RESULT_ERROR_UNKNOWN ;
579
591
}
580
592
593
+ LOG_DEBUG ("removed a value from the file descriptor offset map (addr=%p) - "
594
+ "merged with %p" ,
595
+ highPtr , lowPtr );
596
+
581
597
return UMF_RESULT_SUCCESS ;
582
598
}
583
599
@@ -611,9 +627,7 @@ static umf_result_t file_get_ipc_handle(void *provider, const void *ptr,
611
627
612
628
void * value = critnib_get (file_provider -> fd_offset_map , (uintptr_t )ptr );
613
629
if (value == NULL ) {
614
- LOG_ERR ("file_get_ipc_handle(): getting a value from the IPC cache "
615
- "failed (addr=%p)" ,
616
- ptr );
630
+ LOG_ERR ("getting a value from the IPC cache failed (addr=%p)" , ptr );
617
631
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
618
632
}
619
633
0 commit comments