本文整理汇总了C++中LTRACEF函数的典型用法代码示例。如果您正苦于以下问题:C++ LTRACEF函数的具体用法?C++ LTRACEF怎么用?C++ LTRACEF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LTRACEF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: arch_context_switch
void arch_context_switch(thread_t *oldthread, thread_t *newthread)
{
LTRACEF("old %p (%s), new %p (%s)\n", oldthread, oldthread->name, newthread, newthread->name);
arm64_fpu_pre_context_switch(oldthread);
#if WITH_SMP
DSB; /* broadcast tlb operations in case the thread moves to another cpu */
#endif
arm64_context_switch(&oldthread->arch.sp, newthread->arch.sp);
}
示例2: initial_thread_func
static void initial_thread_func(void)
{
int ret;
thread_t *current_thread = get_current_thread();
LTRACEF("initial_thread_func: thread %p calling %p with arg %p\n", current_thread, current_thread->entry, current_thread->arg);
/* release the thread lock that was implicitly held across the reschedule */
spin_unlock(&thread_lock);
arch_enable_ints();
ret = current_thread->entry(current_thread->arg);
LTRACEF("initial_thread_func: thread %p exiting with %d\n", current_thread, ret);
thread_exit(ret);
}
示例3: ext2_lookup
/* do a path parse, looking up each component */
int ext2_lookup(ext2_t *ext2, const char *_path, inodenum_t *inum)
{
LTRACEF("path '%s', inum %p\n", _path, inum);
char path[512];
strlcpy(path, _path, sizeof(path));
return ext2_walk(ext2, path, &ext2->root_inode, inum, 1);
}
示例4: initial_thread_func
static void initial_thread_func(void)
{
thread_t *ct = get_current_thread();
#if LOCAL_TRACE
LTRACEF("thread %p calling %p with arg %p\n", ct, ct->entry, ct->arg);
dump_thread(ct);
#endif
/* exit the implicit critical section we're within */
exit_critical_section();
int ret = ct->entry(ct->arg);
LTRACEF("thread %p exiting with %d\n", ct, ret);
thread_exit(ret);
}
示例5: page_table_is_clear
static bool page_table_is_clear(pte_t *page_table, uint page_size_shift)
{
int i;
int count = 1U << (page_size_shift - 3);
pte_t pte;
for (i = 0; i < count; i++) {
pte = page_table[i];
if (pte != MMU_PTE_DESCRIPTOR_INVALID) {
LTRACEF("page_table at %p still in use, index %d is 0x%llx\n",
page_table, i, pte);
return false;
}
}
LTRACEF("page table at %p is clear\n", page_table);
return true;
}
示例6: rx_callback
static status_t rx_callback(ep_t endpoint, struct usbc_transfer *transfer)
{
LTRACEF("ep %u, transfer %p\n", endpoint, transfer);
rxqueued = false;
event_signal(&testevent, false);
return NO_ERROR;
}
示例7: calibrate_tsc_count
static uint64_t calibrate_tsc_count(uint16_t duration_ms) {
uint64_t best_time = UINT64_MAX;
for (int tries = 0; tries < 3; ++tries) {
switch (calibration_clock) {
case CLOCK_HPET:
hpet_calibration_cycle_preamble();
break;
case CLOCK_PIT:
pit_calibration_cycle_preamble(duration_ms);
break;
default:
PANIC_UNIMPLEMENTED;
}
// Use CPUID to serialize the instruction stream
uint32_t _ignored;
cpuid(0, &_ignored, &_ignored, &_ignored, &_ignored);
uint64_t start = rdtsc();
cpuid(0, &_ignored, &_ignored, &_ignored, &_ignored);
switch (calibration_clock) {
case CLOCK_HPET:
hpet_calibration_cycle(duration_ms);
break;
case CLOCK_PIT:
pit_calibration_cycle(duration_ms);
break;
default:
PANIC_UNIMPLEMENTED;
}
cpuid(0, &_ignored, &_ignored, &_ignored, &_ignored);
zx_ticks_t end = rdtsc();
cpuid(0, &_ignored, &_ignored, &_ignored, &_ignored);
zx_ticks_t tsc_ticks = end - start;
if (tsc_ticks < best_time) {
best_time = tsc_ticks;
}
LTRACEF("Calibration trial %d found %" PRIu64 " ticks/ms\n",
tries, tsc_ticks);
switch (calibration_clock) {
case CLOCK_HPET:
hpet_calibration_cycle_cleanup();
break;
case CLOCK_PIT:
pit_calibration_cycle_cleanup();
break;
default:
PANIC_UNIMPLEMENTED;
}
}
return best_time;
}
示例8: virtio_gpu_init
status_t virtio_gpu_init(struct virtio_device *dev, uint32_t host_features)
{
LTRACEF("dev %p, host_features 0x%x\n", dev, host_features);
/* allocate a new gpu device */
struct virtio_gpu_dev *gdev = malloc(sizeof(struct virtio_gpu_dev));
if (!gdev)
return ERR_NO_MEMORY;
mutex_init(&gdev->lock);
event_init(&gdev->io_event, false, EVENT_FLAG_AUTOUNSIGNAL);
event_init(&gdev->flush_event, false, EVENT_FLAG_AUTOUNSIGNAL);
gdev->dev = dev;
dev->priv = gdev;
gdev->pmode_id = -1;
gdev->next_resource_id = 1;
/* allocate memory for a gpu request */
#if WITH_KERNEL_VM
gdev->gpu_request = pmm_alloc_kpage();
gdev->gpu_request_phys = vaddr_to_paddr(gdev->gpu_request);
#else
gdev->gpu_request = malloc(sizeof(struct virtio_gpu_resp_display_info)); // XXX get size better
gdev->gpu_request_phys = (paddr_t)gdev->gpu_request;
#endif
/* make sure the device is reset */
virtio_reset_device(dev);
volatile struct virtio_gpu_config *config = (struct virtio_gpu_config *)dev->config_ptr;
dump_gpu_config(config);
/* ack and set the driver status bit */
virtio_status_acknowledge_driver(dev);
// XXX check features bits and ack/nak them
/* allocate a virtio ring */
virtio_alloc_ring(dev, 0, 16);
/* set our irq handler */
dev->irq_driver_callback = &virtio_gpu_irq_driver_callback;
dev->config_change_callback = &virtio_gpu_config_change_callback;
/* set DRIVER_OK */
virtio_status_driver_ok(dev);
/* save the main device we've found */
the_gdev = gdev;
printf("found virtio gpu device\n");
return NO_ERROR;
}
示例9: mem_bdev_write
static ssize_t mem_bdev_write(bdev_t *bdev, const void *buf, off_t offset, size_t len)
{
mem_bdev_t *mem = (mem_bdev_t *)bdev;
LTRACEF("bdev %s, buf %p, offset %lld, len %zu\n", bdev->name, buf, offset, len);
memcpy((uint8_t *)mem->ptr + offset, buf, len);
return len;
}
示例10: test_time_conversion_check_result
static void test_time_conversion_check_result(uint64_t a, uint64_t b, uint64_t limit, bool is32)
{
if (a != b) {
uint64_t diff = is32 ? abs_int32(a - b) : abs_int64(a - b);
if (diff <= limit)
LTRACEF("ROUNDED by %llu (up to %llu allowed)\n", diff, limit);
else
TRACEF("FAIL, off by %llu\n", diff);
}
}
示例11: platform_watchdog_init
/* routines called from lib/watchdog */
status_t platform_watchdog_init(lk_time_t target_timeout,
lk_time_t *recommended_pet_period)
{
LTRACEF("target_timeout %u\n", (uint32_t)target_timeout);
/* make sure the swdt is stopped */
SWDT->MODE = SWDT_MODE_ZKEY | SWDT_MODE_RESERVED;
/* make sure swdt has the proper clock */
SLCR->WDT_CLK_SEL = 0; // cpu 1x
uint32_t swdt_clock = zynq_get_swdt_freq();
/* assuming a prescalar of / 4096, figure out the restart value */
uint32_t restart = ((swdt_clock / 4096) * target_timeout) / 1000;
/* make sure the restart value is <= 24 bits */
if (restart > 0x00ffffff)
restart = 0x00ffffff;
LTRACEF("restart value %u\n", restart);
/* the bottom 12 bits of restart are set to 0xfff by hardware */
restart |= 0xfff;
/* pet period is / 2 the computed restart value */
if (recommended_pet_period)
*recommended_pet_period = ((restart * 1000) / (swdt_clock / 4096)) / 2;
LTRACEF("recommended pet period %u\n", (uint32_t)*recommended_pet_period);
/* set up the swdt */
/* load counter restart (top 12 bits of restart count), pclk / 4096 */
SWDT->CONTROL = SWDT_CONTROL_CKEY | ((restart >> 12) << 2) | 3;
/* zero it out */
SWDT->RESTART = SWDT_RESTART_RSTKEY;
DMB;
return NO_ERROR;
}
示例12: initial_thread_func
static void initial_thread_func(void)
{
thread_t *ct = get_current_thread();
#if LOCAL_TRACE
LTRACEF("thread %p calling %p with arg %p\n", ct, ct->entry, ct->arg);
dump_thread(ct);
#endif
/* release the thread lock that was implicitly held across the reschedule */
spin_unlock(&thread_lock);
arch_enable_ints();
int ret = ct->entry(ct->arg);
LTRACEF("thread %p exiting with %d\n", ct, ret);
thread_exit(ret);
}
示例13: mem_bdev_write_block
static ssize_t mem_bdev_write_block(struct bdev *bdev, const void *buf, bnum_t block, uint count)
{
mem_bdev_t *mem = (mem_bdev_t *)bdev;
LTRACEF("bdev %s, buf %p, block %u, count %u\n", bdev->name, buf, block, count);
memcpy((uint8_t *)mem->ptr + block * BLOCKSIZE, buf, count * BLOCKSIZE);
return count * BLOCKSIZE;
}
示例14: get_io_pll_freq
static uint32_t get_io_pll_freq(void)
{
LTRACEF("IO_PLL_CTRL 0x%x\n", SLCR_REG(IO_PLL_CTRL));
// XXX test that the pll is actually enabled
uint32_t fdiv = BITS_SHIFT(SLCR_REG(IO_PLL_CTRL), 18, 12);
return EXTERNAL_CLOCK_FREQ * fdiv;
}
示例15: arm64_mmu_unmap_pt
static void arm64_mmu_unmap_pt(vaddr_t vaddr, vaddr_t vaddr_rel,
size_t size,
uint index_shift, uint page_size_shift,
pte_t *page_table, uint asid)
{
pte_t *next_page_table;
vaddr_t index;
size_t chunk_size;
vaddr_t vaddr_rem;
vaddr_t block_size;
vaddr_t block_mask;
pte_t pte;
paddr_t page_table_paddr;
LTRACEF("vaddr 0x%lx, vaddr_rel 0x%lx, size 0x%lx, index shift %d, page_size_shift %d, page_table %p\n",
vaddr, vaddr_rel, size, index_shift, page_size_shift, page_table);
while (size) {
block_size = 1UL << index_shift;
block_mask = block_size - 1;
vaddr_rem = vaddr_rel & block_mask;
chunk_size = MIN(size, block_size - vaddr_rem);
index = vaddr_rel >> index_shift;
pte = page_table[index];
if (index_shift > page_size_shift &&
(pte & MMU_PTE_DESCRIPTOR_MASK) == MMU_PTE_L012_DESCRIPTOR_TABLE) {
page_table_paddr = pte & MMU_PTE_OUTPUT_ADDR_MASK;
next_page_table = paddr_to_kvaddr(page_table_paddr);
arm64_mmu_unmap_pt(vaddr, vaddr_rem, chunk_size,
index_shift - (page_size_shift - 3),
page_size_shift,
next_page_table, asid);
if (chunk_size == block_size ||
page_table_is_clear(next_page_table, page_size_shift)) {
LTRACEF("pte %p[0x%lx] = 0 (was page table)\n", page_table, index);
page_table[index] = MMU_PTE_DESCRIPTOR_INVALID;
__asm__ volatile("dmb ishst" ::: "memory");
free_page_table(next_page_table, page_table_paddr, page_size_shift);
}
} else if (pte) {