• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ seq_puts函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: render_sigset_t

void render_sigset_t(struct seq_file *m, const char *header,
				sigset_t *set)
{
	int i;

	seq_puts(m, header);

	i = _NSIG;
	do {
		int x = 0;

		i -= 4;
		if (sigismember(set, i+1)) x |= 1;
		if (sigismember(set, i+2)) x |= 2;
		if (sigismember(set, i+3)) x |= 4;
		if (sigismember(set, i+4)) x |= 8;
		seq_printf(m, "%x", x);
	} while (i >= 4);

	seq_putc(m, '\n');
}
开发者ID:020gzh,项目名称:linux,代码行数:21,代码来源:array.c


示例2: read_file_queues

static int read_file_queues(struct seq_file *file, void *data)
{
	struct ieee80211_hw *hw = dev_get_drvdata(file->private);
	struct ath_softc *sc = hw->priv;
	struct ath_txq *txq;
	int i;
	static const char *qname[4] = {
		"VO", "VI", "BE", "BK"
	};

	for (i = 0; i < IEEE80211_NUM_ACS; i++) {
		txq = sc->tx.txq_map[i];
		seq_printf(file, "(%s):  ", qname[i]);
		print_queue(sc, txq, file);
	}

	seq_puts(file, "(CAB): ");
	print_queue(sc, sc->beacon.cabq, file);

	return 0;
}
开发者ID:EvolutionMod,项目名称:ath10-lenovo,代码行数:21,代码来源:debug.c


示例3: vlan_seq_show

static int vlan_seq_show(struct seq_file *seq, void *v)
{
	if (v == SEQ_START_TOKEN) {
		const char *nmtype = NULL;

		seq_puts(seq, "VLAN Dev name	 | VLAN ID\n");

		if (vlan_name_type < ARRAY_SIZE(vlan_name_type_str))
		    nmtype =  vlan_name_type_str[vlan_name_type];

		seq_printf(seq, "Name-Type: %s\n",
			   nmtype ? nmtype :  "UNKNOWN" );
	} else {
		const struct net_device *vlandev = v;
		const struct vlan_dev_info *dev_info = VLAN_DEV_INFO(vlandev);

		seq_printf(seq, "%-15s| %d  | %s\n",  vlandev->name,
			   dev_info->vlan_id,    dev_info->real_dev->name);
	}
	return 0;
}
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:21,代码来源:vlanproc.c


示例4: xprt_rdma_print_stats

void xprt_rdma_print_stats(struct rpc_xprt *xprt, struct seq_file *seq)
{
	struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
	long idle_time = 0;

	if (xprt_connected(xprt))
		idle_time = (long)(jiffies - xprt->last_used) / HZ;

	seq_puts(seq, "\txprt:\trdma ");
	seq_printf(seq, "%u %lu %lu %lu %ld %lu %lu %lu %llu %llu ",
		   0,	/* need a local port? */
		   xprt->stat.bind_count,
		   xprt->stat.connect_count,
		   xprt->stat.connect_time / HZ,
		   idle_time,
		   xprt->stat.sends,
		   xprt->stat.recvs,
		   xprt->stat.bad_xids,
		   xprt->stat.req_u,
		   xprt->stat.bklog_u);
	seq_printf(seq, "%lu %lu %lu %llu %llu %llu %llu %lu %lu %lu %lu ",
		   r_xprt->rx_stats.read_chunk_count,
		   r_xprt->rx_stats.write_chunk_count,
		   r_xprt->rx_stats.reply_chunk_count,
		   r_xprt->rx_stats.total_rdma_request,
		   r_xprt->rx_stats.total_rdma_reply,
		   r_xprt->rx_stats.pullup_copy_count,
		   r_xprt->rx_stats.fixup_copy_count,
		   r_xprt->rx_stats.hardway_register_count,
		   r_xprt->rx_stats.failed_marshal_count,
		   r_xprt->rx_stats.bad_reply_count,
		   r_xprt->rx_stats.nomsg_call_count);
	seq_printf(seq, "%lu %lu %lu %lu %lu %lu\n",
		   r_xprt->rx_stats.mrs_recycled,
		   r_xprt->rx_stats.mrs_orphaned,
		   r_xprt->rx_stats.mrs_allocated,
		   r_xprt->rx_stats.local_inv_needed,
		   r_xprt->rx_stats.empty_sendctx_q,
		   r_xprt->rx_stats.reply_waits_for_send);
}
开发者ID:markus-oberhumer,项目名称:linux,代码行数:40,代码来源:transport.c


示例5: show_interrupts

/*
 * show_interrupts()
 *	Return a string that displays the state of each of the interrupts.
 */
int show_interrupts(struct seq_file *p, void *v)
{
	struct irqaction *ap;
	int irq = *((loff_t *) v);
	struct irq_desc *desc = irq_to_desc(irq);
	int j;


	if (irq >= NR_IRQS) {
		return 0;
	}

	if (irq == 0) {
		seq_puts(p, "           ");
		for_each_online_cpu(j) {
			seq_printf(p, "CPU%d       ", j);
		}
#if defined(IRQ_REENTRANT_COUNT)
		seq_printf(p, "Reentrant?");
#endif
		seq_putc(p, '\n');
	}
开发者ID:patrick-ken,项目名称:MyNet_N900,代码行数:26,代码来源:irq.c


示例6: acpi_processor_limit_seq_show

static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
{
	struct acpi_processor *pr = seq->private;

	if (!pr)
		goto end;

	if (!pr->flags.limit) {
		seq_puts(seq, "<not supported>\n");
		goto end;
	}

	seq_printf(seq, "active limit:            P%d:T%d\n"
		   "user limit:              P%d:T%d\n"
		   "thermal limit:           P%d:T%d\n",
		   pr->limit.state.px, pr->limit.state.tx,
		   pr->limit.user.px, pr->limit.user.tx,
		   pr->limit.thermal.px, pr->limit.thermal.tx);

      end:
	return 0;
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:22,代码来源:processor_thermal.c


示例7: proc_cgroupstats_show

/* Display information about each subsystem and each hierarchy */
int proc_cgroupstats_show(struct seq_file *m, void *v)
{
	struct cgroup_subsys *ss;
	int i;

	seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n");
	/*
	 * ideally we don't want subsystems moving around while we do this.
	 * cgroup_mutex is also necessary to guarantee an atomic snapshot of
	 * subsys/hierarchy state.
	 */
	mutex_lock(&cgroup_mutex);

	for_each_subsys(ss, i)
		seq_printf(m, "%s\t%d\t%d\t%d\n",
			   ss->legacy_name, ss->root->hierarchy_id,
			   atomic_read(&ss->root->nr_cgrps),
			   cgroup_ssid_enabled(i));

	mutex_unlock(&cgroup_mutex);
	return 0;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:23,代码来源:cgroup-v1.c


示例8: udelay_test_single

static int udelay_test_single(struct seq_file *s, int usecs, uint32_t iters)
{
	int min = 0, max = 0, fail_count = 0;
	uint64_t sum = 0;
	uint64_t avg;
	int i;
	/* Allow udelay to be up to 0.5% fast */
	int allowed_error_ns = usecs * 5;

	for (i = 0; i < iters; ++i) {
		s64 kt1, kt2;
		int time_passed;

		kt1 = ktime_get_ns();
		udelay(usecs);
		kt2 = ktime_get_ns();
		time_passed = kt2 - kt1;

		if (i == 0 || time_passed < min)
			min = time_passed;
		if (i == 0 || time_passed > max)
			max = time_passed;
		if ((time_passed + allowed_error_ns) / 1000 < usecs)
			++fail_count;
		WARN_ON(time_passed < 0);
		sum += time_passed;
	}

	avg = sum;
	do_div(avg, iters);
	seq_printf(s, "%d usecs x %d: exp=%d allowed=%d min=%d avg=%lld max=%d",
			usecs, iters, usecs * 1000,
			(usecs * 1000) - allowed_error_ns, min, avg, max);
	if (fail_count)
		seq_printf(s, " FAIL=%d", fail_count);
	seq_puts(s, "\n");

	return 0;
}
开发者ID:AK101111,项目名称:linux,代码行数:39,代码来源:test_udelay.c


示例9: show_interrupts

int show_interrupts(struct seq_file *p, void *v)
{
	int j, i = *(loff_t *) v;
	struct irqaction * action;
	irq_desc_t *idesc;
	unsigned long flags;

	if (i == 0) {
		seq_puts(p, "           ");
		for (j=0; j<NR_CPUS; j++)
			if (cpu_online(j))
				seq_printf(p, "CPU%d       ",j);
		seq_putc(p, '\n');
	}

	if (i < NR_IRQS) {
		idesc = irq_descp(i);
		spin_lock_irqsave(&idesc->lock, flags);
		action = idesc->action;
		if (!action)
			goto skip;
		seq_printf(p, "%3d: ",i);
#ifndef CONFIG_SMP
		seq_printf(p, "%10u ", kstat_irqs(i));
#else
		for (j = 0; j < NR_CPUS; j++)
			if (cpu_online(j))
				seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
#endif
		seq_printf(p, " %14s", idesc->handler->typename);
		seq_printf(p, "  %s", action->name);

		for (action=action->next; action; action = action->next)
			seq_printf(p, ", %s", action->name);

		seq_putc(p, '\n');
skip:
		spin_unlock_irqrestore(&idesc->lock, flags);
	} else if (i == NR_IRQS) {
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:39,代码来源:irq.c


示例10: jit_tasklet_proc_show

/* the /proc function: allocate everything to allow concurrency. */
static int jit_tasklet_proc_show(struct seq_file *m, void *v)
{
	struct jit_data *data;
	unsigned long j = jiffies;
	long hi = (long)m->private;

	data = kmalloc(sizeof(*data), GFP_KERNEL);
	if (!data)
		return -ENOMEM;

	init_waitqueue_head (&data->wait);

	/* Write the first lines in the buffer. */
	seq_puts(m, "   time   delta  inirq    pid   cpu command\n");
	seq_printf(m, "%9li  %3li     %i    %6i   %i   %s\n",
			j, 0L, in_interrupt() ? 1 : 0,
			current->pid, smp_processor_id(), current->comm);

	/* Fill the data for our tasklet function. */
	data->prevjiffies = j;
	data->m = m;
	data->loops = JIT_ASYNC_LOOPS;
	
	/* Register the tasklet. */
	tasklet_init(&data->tlet, jit_tasklet_fn, (unsigned long)data);
	data->hi = hi;
	if (hi)
		tasklet_hi_schedule(&data->tlet);
	else
		tasklet_schedule(&data->tlet);

	/* Wait for the buffer to fill. */
	wait_event_interruptible(data->wait, !data->loops);

	if (signal_pending(current))
		return -ERESTARTSYS;
	kfree(data);
    return 0;
}
开发者ID:pinglunliao,项目名称:ldd3,代码行数:40,代码来源:jit.c


示例11: qla_dfs_fw_resource_cnt_show

static int
qla_dfs_fw_resource_cnt_show(struct seq_file *s, void *unused)
{
	struct scsi_qla_host *vha = s->private;
	struct qla_hw_data *ha = vha->hw;

	seq_puts(s, "FW Resource count\n\n");
	seq_printf(s, "Original TGT exchg count[%d]\n",
	    ha->orig_fw_tgt_xcb_count);
	seq_printf(s, "current TGT exchg count[%d]\n",
	    ha->cur_fw_tgt_xcb_count);
	seq_printf(s, "original Initiator Exchange count[%d]\n",
	    ha->orig_fw_xcb_count);
	seq_printf(s, "Current Initiator Exchange count[%d]\n",
	    ha->cur_fw_xcb_count);
	seq_printf(s, "Original IOCB count[%d]\n", ha->orig_fw_iocb_count);
	seq_printf(s, "Current IOCB count[%d]\n", ha->cur_fw_iocb_count);
	seq_printf(s, "MAX VP count[%d]\n", ha->max_npiv_vports);
	seq_printf(s, "MAX FCF count[%d]\n", ha->fw_max_fcf_count);

	return 0;
}
开发者ID:andy-shev,项目名称:linux,代码行数:22,代码来源:qla_dfs.c


示例12: afs_proc_cells_show

/*
 * Display the list of cells known to the namespace.
 */
static int afs_proc_cells_show(struct seq_file *m, void *v)
{
	struct afs_vlserver_list *vllist;
	struct afs_cell *cell;

	if (v == SEQ_START_TOKEN) {
		/* display header on line 1 */
		seq_puts(m, "USE    TTL SV NAME\n");
		return 0;
	}

	cell = list_entry(v, struct afs_cell, proc_link);
	vllist = rcu_dereference(cell->vl_servers);

	/* display one cell per line on subsequent lines */
	seq_printf(m, "%3u %6lld %2u %s\n",
		   atomic_read(&cell->usage),
		   cell->dns_expiry - ktime_get_real_seconds(),
		   vllist ? vllist->nr_servers : 0,
		   cell->name);
	return 0;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:25,代码来源:proc.c


示例13: wakeup_reason_stats_show

static int wakeup_reason_stats_show(struct seq_file *s, void *unused)
{
	int i;

	seq_puts(s, "eint_no\tirq\twakeup_count\tname\n");
	for (i = 0; i < NR_EINT; i++) {
		struct irq_desc *desc = irq_to_desc(wakeup_reason_stats[i].irq);
		const char *irq_name = NULL;

		if (!wakeup_reason_stats[i].irq)
			continue;

		if (desc && desc->action && desc->action->name)
			irq_name = desc->action->name;

		seq_printf(s, "%d\t%d\t%u\t\t%s\n", i,
				wakeup_reason_stats[i].irq,
				wakeup_reason_stats[i].wakeup_count, irq_name);
	}

	return 0;
}
开发者ID:MikeForeskin,项目名称:Vindicator-S6,代码行数:22,代码来源:wakeup_reason.c


示例14: task_name

static inline void task_name(struct seq_file *m, struct task_struct *p)
{
	int i;
	char *buf, *end;
	char *name;
	char tcomm[sizeof(p->comm)];

	get_task_comm(tcomm, p);

	seq_puts(m, "Name:\t");
	end = m->buf + m->size;
	buf = m->buf + m->count;
	name = tcomm;
	i = sizeof(tcomm);
	while (i && (buf < end)) {
		unsigned char c = *name;
		name++;
		i--;
		*buf = c;
		if (!c)
			break;
		if (c == '\\') {
			buf++;
			if (buf < end)
				*buf++ = c;
			continue;
		}
		if (c == '\n') {
			*buf++ = '\\';
			if (buf < end)
				*buf++ = 'n';
			continue;
		}
		buf++;
	}
	m->count = buf - m->buf;
	seq_putc(m, '\n');
}
开发者ID:Albinoman887,项目名称:pyramid-3.4.10,代码行数:38,代码来源:array.c


示例15: jit_timer_proc_show

static int jit_timer_proc_show(struct seq_file *m, void *v)
/******************************************************************************/
{
	struct jit_data *data;
	unsigned long j = jiffies;

	data = kmalloc(sizeof(*data), GFP_KERNEL);
	if (!data)
		return -ENOMEM;

	init_timer(&data->timer);
	init_waitqueue_head (&data->wait);

	/* write the first lines in the buffer */
	seq_puts(m, "   time   delta  inirq    pid   cpu command\n");
	seq_printf(m, "%9li  %3li     %i    %6i   %i   %s\n",
		j, 0L, in_interrupt() ? 1 : 0,
		current->pid, smp_processor_id(), current->comm);

	/* fill the data for our timer function */
	data->prevjiffies = j;
	data->m = m;
	data->loops = JIT_ASYNC_LOOPS;
	
	/* register the timer */
	data->timer.data = (unsigned long)data;
	data->timer.function = jit_timer_fn;
	data->timer.expires = j + tdelay; /* parameter */
	add_timer(&data->timer);

	/* wait for the buffer to fill */
	wait_event_interruptible(data->wait, !data->loops);
	if (signal_pending(current))
		return -ERESTARTSYS;

	kfree(data);
	return 0;
}
开发者ID:yuri-tolstov,项目名称:projects,代码行数:38,代码来源:hello.c


示例16: pinmux_functions_show

/* Called from pincontrol core */
static int pinmux_functions_show(struct seq_file *s, void *what)
{
    struct pinctrl_dev *pctldev = s->private;
    const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
    unsigned nfuncs;
    unsigned func_selector = 0;

    if (!pmxops)
        return 0;

    mutex_lock(&pinctrl_mutex);
    nfuncs = pmxops->get_functions_count(pctldev);
    while (func_selector < nfuncs) {
        const char *func = pmxops->get_function_name(pctldev,
                           func_selector);
        const char * const *groups;
        unsigned num_groups;
        int ret;
        int i;

        ret = pmxops->get_function_groups(pctldev, func_selector,
                                          &groups, &num_groups);
        if (ret)
            seq_printf(s, "function %s: COULD NOT GET GROUPS\n",
                       func);

        seq_printf(s, "function: %s, groups = [ ", func);
        for (i = 0; i < num_groups; i++)
            seq_printf(s, "%s ", groups[i]);
        seq_puts(s, "]\n");

        func_selector++;
    }

    mutex_unlock(&pinctrl_mutex);

    return 0;
}
开发者ID:kennethlyn,项目名称:parallella-lcd-linux,代码行数:39,代码来源:pinmux.c


示例17: imx1_pinconf_group_dbg_show

static void imx1_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
					 struct seq_file *s, unsigned group)
{
	struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
	const struct imx1_pinctrl_soc_info *info = ipctl->info;
	struct imx1_pin_group *grp;
	unsigned long config;
	const char *name;
	int i, ret;

	if (group > info->ngroups)
		return;

	seq_puts(s, "\n");
	grp = &info->groups[group];
	for (i = 0; i < grp->npins; i++) {
		name = pin_get_name(pctldev, grp->pins[i].pin_id);
		ret = imx1_pinconf_get(pctldev, grp->pins[i].pin_id, &config);
		if (ret)
			return;
		seq_printf(s, "%s: 0x%lx", name, config);
	}
}
开发者ID:AkyZero,项目名称:wrapfs-latest,代码行数:23,代码来源:pinctrl-imx1-core.c


示例18: send_host_cmd_v_blank_dcs

static int send_host_cmd_v_blank_dcs(struct seq_file *s, void *unused)
{
    struct tegra_dc_dsi_data *dsi = s->private;
    int err;

    struct tegra_dsi_cmd user_command[] = {
        DSI_CMD_SHORT(data_id, command_value, command_value1),
        DSI_DLY_MS(20),
    };

    if (!dsi->enabled) {
        seq_puts(s, "DSI controller suspended\n");
        return 0;
    }

    seq_printf(s, "data_id taken :0x%x\n", data_id);
    seq_printf(s, "command value taken :0x%x\n", command_value);
    seq_printf(s, "second command value taken :0x%x\n", command_value1);

    err = tegra_dsi_start_host_cmd_v_blank_dcs(dsi, user_command);

    return err;
}
开发者ID:Sublime-Development,项目名称:kernel_flounder,代码行数:23,代码来源:dsi_debug.c


示例19: arch_show_interrupts

/*
 * /proc/interrupts printing for arch specific interrupts
 */
int arch_show_interrupts(struct seq_file *p, int prec)
{
    int j;

#ifdef CONFIG_DEBUG_STACKOVERFLOW
    seq_printf(p, "%*s: ", prec, "STK");
    for_each_online_cpu(j)
    seq_printf(p, "%10u ", irq_stats(j)->kernel_stack_usage);
    seq_puts(p, "  Kernel stack usage\n");
# ifdef CONFIG_IRQSTACKS
    seq_printf(p, "%*s: ", prec, "IST");
    for_each_online_cpu(j)
    seq_printf(p, "%10u ", irq_stats(j)->irq_stack_usage);
    seq_puts(p, "  Interrupt stack usage\n");
# endif
#endif
#ifdef CONFIG_SMP
    seq_printf(p, "%*s: ", prec, "RES");
    for_each_online_cpu(j)
    seq_printf(p, "%10u ", irq_stats(j)->irq_resched_count);
    seq_puts(p, "  Rescheduling interrupts\n");
    seq_printf(p, "%*s: ", prec, "CAL");
    for_each_online_cpu(j)
    seq_printf(p, "%10u ", irq_stats(j)->irq_call_count);
    seq_puts(p, "  Function call interrupts\n");
#endif
    seq_printf(p, "%*s: ", prec, "UAH");
    for_each_online_cpu(j)
    seq_printf(p, "%10u ", irq_stats(j)->irq_unaligned_count);
    seq_puts(p, "  Unaligned access handler traps\n");
    seq_printf(p, "%*s: ", prec, "FPA");
    for_each_online_cpu(j)
    seq_printf(p, "%10u ", irq_stats(j)->irq_fpassist_count);
    seq_puts(p, "  Floating point assist traps\n");
    seq_printf(p, "%*s: ", prec, "TLB");
    for_each_online_cpu(j)
    seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count);
    seq_puts(p, "  TLB shootdowns\n");
    return 0;
}
开发者ID:friedrich420,项目名称:Ael-Zen-Kernel-Asus-Zenfone2-,代码行数:43,代码来源:irq.c


示例20: segment_bits_seq_show

static int segment_bits_seq_show(struct seq_file *seq, void *offset)
{
	struct super_block *sb = seq->private;
	struct f2fs_sb_info *sbi = F2FS_SB(sb);
	unsigned int total_segs =
			le32_to_cpu(sbi->raw_super->segment_count_main);
	int i, j;

	seq_puts(seq, "format: segment_type|valid_blocks|bitmaps\n"
		"segment_type(0:HD, 1:WD, 2:CD, 3:HN, 4:WN, 5:CN)\n");

	for (i = 0; i < total_segs; i++) {
		struct seg_entry *se = get_seg_entry(sbi, i);

		seq_printf(seq, "%-10d", i);
		seq_printf(seq, "%d|%-3u|", se->type,
					get_valid_blocks(sbi, i, false));
		for (j = 0; j < SIT_VBLOCK_MAP_SIZE; j++)
			seq_printf(seq, " %.2x", se->cur_valid_map[j]);
		seq_putc(seq, '\n');
	}
	return 0;
}
开发者ID:mkrufky,项目名称:linux,代码行数:23,代码来源:sysfs.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ seqcount_init函数代码示例发布时间:2022-05-30
下一篇:
C++ seq_putc函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap