当前位置: 首页>>代码示例>>C++>>正文


C++ show_stack函数代码示例

本文整理汇总了C++中show_stack函数的典型用法代码示例。如果您正苦于以下问题:C++ show_stack函数的具体用法?C++ show_stack怎么用?C++ show_stack使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了show_stack函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: kdb_show_stack

static int kdb_show_stack(struct task_struct *p, void *addr, int argcount)
{
	/* Use KDB arch-specific backtraces for ia64 */
#ifdef CONFIG_IA64
	return kdba_bt_process(p, argcount);
#else
	/* Use the in-kernel backtraces */
	int old_lvl = console_loglevel;
	console_loglevel = 15;
	kdba_set_current_task(p);
	if (addr) {
		show_stack((struct task_struct *)p, addr);
	} else if (kdb_current_regs) {
#ifdef CONFIG_X86
		show_stack(p, &kdb_current_regs->sp);
#else
		show_stack(p, NULL);
#endif
	} else {
		show_stack(p, NULL);
	}
	console_loglevel = old_lvl;
	return 0;
#endif /* CONFIG_IA64 */
}
开发者ID:mongmio,项目名称:ivyproject_thermal,代码行数:25,代码来源:kdb_bt.c

示例2: do_print_all

void do_print_all (stack *stack) {
   DEBUGS ('m', show_stack (stack));
   int size = size_stack (stack);
   for (int index = 0; index < size; ++index) {
      print_bigint (peek_stack (stack, index));
   }
}
开发者ID:Adam-K-P,项目名称:School-work,代码行数:7,代码来源:main.c

示例3: tce_build_pSeriesLP

static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
				long npages, unsigned long uaddr,
				enum dma_data_direction direction)
{
	u64 rc;
	union tce_entry tce;

	tcenum <<= TCE_PAGE_FACTOR;
	npages <<= TCE_PAGE_FACTOR;

	tce.te_word = 0;
	tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
	tce.te_rdwr = 1;
	if (direction != DMA_TO_DEVICE)
		tce.te_pciwr = 1;

	while (npages--) {
		rc = plpar_tce_put((u64)tbl->it_index, 
				   (u64)tcenum << 12, 
				   tce.te_word );
		
		if (rc && printk_ratelimit()) {
			printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
			printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
			printk("\ttcenum  = 0x%lx\n", (u64)tcenum);
			printk("\ttce val = 0x%lx\n", tce.te_word );
			show_stack(current, (unsigned long *)__get_SP());
		}
			
		tcenum++;
		tce.te_rpn++;
	}
}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:33,代码来源:iommu.c

示例4: show_stack

        static void show_stack(lua_State* st, int n)
        {
            lua_Debug	ar;
            if(lua_getstack(st, n, &ar) == 1) {
                lua_getinfo(st, "nSlu", &ar);
                const char* indent;
                if(n == 0) {
                    indent = "->\t";
                    print_error(st, "\t<call stack>");
                }
                else {
                    indent = "\t";
                }
                if(ar.name)
                    print_error(st, "%s%s(): line %d [%s: line %d]",
                                indent, ar.name, ar.currentline, ar.source,
                                ar.linedefined);
                else
                    print_error(st, "%sunknown: line %d [%s: line %d]",
                                indent, ar.currentline, ar.source,
                                ar.linedefined);

                show_stack(st, n + 1);
            }
        }
开发者ID:zigzed,项目名称:common,代码行数:25,代码来源:scriptvm.cpp

示例5: raise_backtrace_ipi

static void raise_backtrace_ipi(cpumask_t *mask)
{
	unsigned int cpu;

	for_each_cpu(cpu, mask) {
		if (cpu == smp_processor_id())
			handle_backtrace_ipi(NULL);
		else
			smp_send_safe_nmi_ipi(cpu, handle_backtrace_ipi, 5 * USEC_PER_SEC);
	}

	for_each_cpu(cpu, mask) {
		struct paca_struct *p = paca_ptrs[cpu];

		cpumask_clear_cpu(cpu, mask);

		pr_warn("CPU %d didn't respond to backtrace IPI, inspecting paca.\n", cpu);
		if (!virt_addr_valid(p)) {
			pr_warn("paca pointer appears corrupt? (%px)\n", p);
			continue;
		}

		pr_warn("irq_soft_mask: 0x%02x in_mce: %d in_nmi: %d",
			p->irq_soft_mask, p->in_mce, p->in_nmi);

		if (virt_addr_valid(p->__current))
			pr_cont(" current: %d (%s)\n", p->__current->pid,
				p->__current->comm);
		else
			pr_cont(" current pointer corrupt? (%px)\n", p->__current);

		pr_warn("Back trace of paca->saved_r1 (0x%016llx) (possibly stale):\n", p->saved_r1);
		show_stack(p->__current, (unsigned long *)p->saved_r1);
	}
}
开发者ID:CCNITSilchar,项目名称:linux,代码行数:35,代码来源:stacktrace.c

示例6: tce_free_pSeriesLP

static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages)
{
	u64 rc;
	union tce_entry tce;

	tcenum <<= TCE_PAGE_FACTOR;
	npages <<= TCE_PAGE_FACTOR;

	tce.te_word = 0;

	while (npages--) {
		rc = plpar_tce_put((u64)tbl->it_index,
				   (u64)tcenum << 12,
				   tce.te_word);

		if (rc && printk_ratelimit()) {
			printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
			printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
			printk("\ttcenum  = 0x%lx\n", (u64)tcenum);
			printk("\ttce val = 0x%lx\n", tce.te_word );
			show_stack(current, (unsigned long *)__get_SP());
		}

		tcenum++;
	}
}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:26,代码来源:iommu.c

示例7: ShowStatus

static void ShowStatus (void) {
	struct task_struct * task ;
	for_each_process(task) {
		printk_deferred("[Hang_Detect] %s found:%d.,RT[%lld]\n", task->comm, task->pid, sched_clock());
		show_stack(task,NULL) ;
	}
}
开发者ID:blackrebel75,项目名称:HUAWEI89_WE_KK_700,代码行数:7,代码来源:monitor_hang.c

示例8: tstack

/* 
  *  f: bit0: show kernel , bit1: dump user.
  */
int tstack( int pid , int f)
{
        struct pt_regs * preg;
        struct task_struct *t = FIND_TASK_BY_PID( pid );
        
        if( !t ){
                printk("NO task found for pid %d\n" ,pid );
                t = current ;
        }
        preg = unwind_get_regs( t );
        if( f& 1 ) {
                show_stack( t , NULL );
        }
        if( !preg ) {
                printk("NO user stack found for task %s(%d)\n" , t->comm , t->pid );
        } else {
                //printk("user stack found for task %s(%d):\n" , t->comm , t->pid );
                __show_regs( preg );
                if( f & 2 ) {
                        #define SHOW_STACK_SIZE         (2*1024)
                        int len;
                        unsigned int *ps = (unsigned int*)kmalloc( SHOW_STACK_SIZE , GFP_KERNEL);
                        if( ps ) {
                                len = access_process_vm( t , preg->ARM_sp , ps , SHOW_STACK_SIZE, 0 );
                                rk28_printk_mem( ps , len/4 , (unsigned int* )preg->ARM_sp );
                                kfree( ps );
                        }
                }
        }
        return pid;
}
开发者ID:loyfan,项目名称:android-kernel-mediacom-mp810c,代码行数:34,代码来源:debug.c

示例9: print_backtrace_and_die

void print_backtrace_and_die(int sig, siginfo_t *info, void *secret)
{
	ucontext_t *uc = secret;
	unsigned long ip, bp, sp, addr;

	ip	= uc->uc_mcontext.gregs[IP_REG];
	bp	= uc->uc_mcontext.gregs[BP_REG];
	sp	= uc->uc_mcontext.gregs[SP_REG];
	addr	= (unsigned long) info->si_addr;

	switch (sig) {
	case SIGSEGV:
		trace_printf("SIGSEGV at %s %08lx while accessing memory address %08lx.\n",
			IP_REG_NAME, ip, addr);
		break;
	case SIGILL:
		trace_printf("SIGILL at %s %08lx\n", sig, IP_REG_NAME, ip);
		break;
	default:
		trace_printf("Signal %d at %s %08lx\n", sig, IP_REG_NAME, ip);
		break;
	};

	show_registers(uc->uc_mcontext.gregs);

	show_stack((void *) sp);

	show_code((void *) ip);

	print_trace_from(ip, (void *) bp);

	trace_flush();

	abort();
}
开发者ID:abak,项目名称:jato,代码行数:35,代码来源:backtrace.c

示例10: snapdog_service

void
snapdog_service(struct pt_regs *regs)
{
	int the_dog_is_alive = 0;

	if (snapdog_kernel) {
		the_dog_is_alive = 1;
	} else if (!snapdog_service_required) {
		the_dog_is_alive = 1;
	} else if (snapdog_next < snapdog_last) {
		if (jiffies < snapdog_next || jiffies > snapdog_last)
			the_dog_is_alive = 1;
	} else if (jiffies >= snapdog_last && jiffies < snapdog_next) {
		the_dog_is_alive = 1;
	}

	if (the_dog_is_alive)
		poke_the_dog();
	else if (!snapdog_warned) {
		snapdog_warned = 1;
		printk(KERN_CRIT "snapdog: expired, allowing system reboot.\n");
		if (regs) {
			show_regs(regs);
			show_stack(regs);
		}
		the_dog_is_dead();
	}
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:28,代码来源:snapdog.c

示例11: print_buffer_trace

void print_buffer_trace(struct buffer_head *bh)
{
#ifdef CONFIG_X86
	extern void show_stack(unsigned long * esp);
#endif

	unsigned long idx, count;
	unsigned long flags;

	printk("buffer trace for buffer at 0x%p (I am CPU %d)\n",
			bh, smp_processor_id());
	BUFFER_TRACE(bh, "");		/* Record state now */

	spin_lock_irqsave(&trace_lock, flags);
	for (	idx = bh->b_history.b_history_tail, count = 0;
		idx < bh->b_history.b_history_head &&
			count < BUFFER_HISTORY_SIZE;
		idx++, count++)
		print_one_hist(bh->b_history.b +
			(idx & (BUFFER_HISTORY_SIZE - 1)));

	print_buffer_fields(bh);
	spin_unlock_irqrestore(&trace_lock, flags);
#ifdef CONFIG_X86
	show_stack(NULL);
#endif
	printk("\n");
}
开发者ID:liuxueyang,项目名称:Linux-Unix,代码行数:28,代码来源:jbd-kernel.c

示例12: aee_dumpbasic

/* For user mode or the case KDB is not enabled, print basic debug messages */
void aee_dumpbasic(void)
{
	struct task_struct *p = current;
	int orig_log_level = console_loglevel;

	preempt_disable();
	console_loglevel = 7;
	LOGI("kernel  : %s-%s\n", init_uts_ns.name.sysname, init_uts_ns.name.release);
	LOGI("version : %s\n", init_uts_ns.name.version);
	LOGI("machine : %s\n\n", init_uts_ns.name.machine);

#ifdef CONFIG_SCHED_DEBUG
	sysrq_sched_debug_show();
#endif
	LOGI("\n%-*s      Pid   Parent Command\n", (int)(2 * sizeof(void *)) + 2, "Task Addr");
	LOGI("0x%p %8d %8d  %s\n\n", (void *)p, p->pid, p->parent->pid, p->comm);
	LOGI("Stack traceback for current pid %d\n", p->pid);
	show_stack(p, NULL);

#ifdef CONFIG_MTK_AEE_IPANIC_64
	aee_dumpnative();
#endif

	console_loglevel = orig_log_level;
	preempt_enable();
}
开发者ID:AudioGod,项目名称:MediaTek-HelioX10-Kernel,代码行数:27,代码来源:aee-common.c

示例13: print_task

static void
print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
{
	if (rq->curr == p)
		SEQ_printf(m, "R");
	else
		SEQ_printf(m, " ");

	SEQ_printf(m, "%15s %5d %9Ld.%06ld %9Ld %5d ",
		p->comm, p->pid,
		SPLIT_NS(p->se.vruntime),
		(long long)(p->nvcsw + p->nivcsw),
		p->prio);
#ifdef CONFIG_SCHEDSTATS
	SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
		SPLIT_NS(p->se.vruntime),
		SPLIT_NS(p->se.sum_exec_runtime),
		SPLIT_NS(p->se.statistics.sum_sleep_runtime));
#else
	SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
		0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
#endif
#ifdef CONFIG_CGROUP_SCHED
	SEQ_printf(m, " %s", task_group_path(task_group(p)));
#endif

	SEQ_printf(m, "\n");
	if (!m) show_stack(p, NULL);
}
开发者ID:Clumsy-Kernel-Development,项目名称:M9_Kernel,代码行数:29,代码来源:debug.c

示例14: check_bug_trap

int
check_bug_trap(struct pt_regs *regs)
{
	struct bug_entry *bug;
	unsigned long addr;

	if (regs->msr & MSR_PR)
		return 0;	/* not in kernel */
	addr = regs->nip;	/* address of trap instruction */
	if (addr < PAGE_OFFSET)
		return 0;
	bug = find_bug(regs->nip);
	if (bug == NULL)
		return 0;
	if (bug->line & BUG_WARNING_TRAP) {
		/* this is a WARN_ON rather than BUG/BUG_ON */
		printk(KERN_ERR "Badness in %s at %s:%d\n",
		       bug->function, bug->file,
		      (unsigned int)bug->line & ~BUG_WARNING_TRAP);
		show_stack(current, (void *)regs->gpr[1]);
		return 1;
	}
	printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
	       bug->function, bug->file, (unsigned int)bug->line);
	return 0;
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:26,代码来源:traps.c

示例15: tce_build_pSeriesLP

static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
				long npages, unsigned long uaddr,
				enum dma_data_direction direction)
{
	u64 rc;
	u64 proto_tce, tce;
	u64 rpn;

	rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
	proto_tce = TCE_PCI_READ;
	if (direction != DMA_TO_DEVICE)
		proto_tce |= TCE_PCI_WRITE;

	while (npages--) {
		tce = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT;
		rc = plpar_tce_put((u64)tbl->it_index, (u64)tcenum << 12, tce);

		if (rc && printk_ratelimit()) {
			printk("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n", rc);
			printk("\tindex   = 0x%lx\n", (u64)tbl->it_index);
			printk("\ttcenum  = 0x%lx\n", (u64)tcenum);
			printk("\ttce val = 0x%lx\n", tce );
			show_stack(current, (unsigned long *)__get_SP());
		}

		tcenum++;
		rpn++;
	}
}
开发者ID:human3000,项目名称:linux-2.6,代码行数:29,代码来源:iommu.c


注:本文中的show_stack函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。