本文整理汇总了C++中seq_putc函数的典型用法代码示例。如果您正苦于以下问题:C++ seq_putc函数的具体用法?C++ seq_putc怎么用?C++ seq_putc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了seq_putc函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: atm_dev_info
static void atm_dev_info(struct seq_file *seq, const struct atm_dev *dev)
{
int i;
seq_printf(seq, "%3d %-8s", dev->number, dev->type);
for (i = 0; i < ESI_LEN; i++)
seq_printf(seq, "%02x", dev->esi[i]);
seq_puts(seq, " ");
add_stats(seq, "0", &dev->stats.aal0);
seq_puts(seq, " ");
add_stats(seq, "5", &dev->stats.aal5);
seq_printf(seq, "\t[%d]", atomic_read(&dev->refcnt));
seq_putc(seq, '\n');
}
开发者ID:020gzh,项目名称:linux,代码行数:14,代码来源:proc.c
示例2: show_interrupts
int show_interrupts(struct seq_file *p, void *v)
{
int i = *(loff_t *) v, j;
struct irqaction * action;
unsigned long flags;
if (i == 0) {
seq_printf(p, " ");
for_each_online_cpu(j)
seq_printf(p, "CPU%d ",j);
seq_putc(p, '\n');
}
if (i < NR_IRQS) {
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
seq_printf(p, "%3d: ",i);
#ifndef CONFIG_SMP
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %14s", irq_desc[i].chip->name);
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:
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}
return 0;
}
开发者ID:Adjustxx,项目名称:Savaged-Zen,代码行数:37,代码来源:irq.c
示例3: show_interrupts
int show_interrupts(struct seq_file *p, void *v)
{
int i = *(loff_t *) v, j;
struct irqaction * action;
unsigned long flags;
if (i == 0) {
seq_printf(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) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].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", irq_desc[i].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(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS) {
开发者ID:QiuLihua83,项目名称:linux-2.6.10,代码行数:37,代码来源:irq.c
示例4: snmp_seq_show_tcp_udp
static int snmp_seq_show_tcp_udp(struct seq_file *seq, void *v)
{
unsigned long buff[TCPUDP_MIB_MAX];
struct net *net = seq->private;
int i;
memset(buff, 0, TCPUDP_MIB_MAX * sizeof(unsigned long));
seq_puts(seq, "\nTcp:");
for (i = 0; snmp4_tcp_list[i].name; i++)
seq_printf(seq, " %s", snmp4_tcp_list[i].name);
seq_puts(seq, "\nTcp:");
snmp_get_cpu_field_batch(buff, snmp4_tcp_list,
net->mib.tcp_statistics);
for (i = 0; snmp4_tcp_list[i].name; i++) {
/* MaxConn field is signed, RFC 2012 */
if (snmp4_tcp_list[i].entry == TCP_MIB_MAXCONN)
seq_printf(seq, " %ld", buff[i]);
else
seq_printf(seq, " %lu", buff[i]);
}
memset(buff, 0, TCPUDP_MIB_MAX * sizeof(unsigned long));
snmp_get_cpu_field_batch(buff, snmp4_udp_list,
net->mib.udp_statistics);
seq_puts(seq, "\nUdp:");
for (i = 0; snmp4_udp_list[i].name; i++)
seq_printf(seq, " %s", snmp4_udp_list[i].name);
seq_puts(seq, "\nUdp:");
for (i = 0; snmp4_udp_list[i].name; i++)
seq_printf(seq, " %lu", buff[i]);
memset(buff, 0, TCPUDP_MIB_MAX * sizeof(unsigned long));
/* the UDP and UDP-Lite MIBs are the same */
seq_puts(seq, "\nUdpLite:");
snmp_get_cpu_field_batch(buff, snmp4_udp_list,
net->mib.udplite_statistics);
for (i = 0; snmp4_udp_list[i].name; i++)
seq_printf(seq, " %s", snmp4_udp_list[i].name);
seq_puts(seq, "\nUdpLite:");
for (i = 0; snmp4_udp_list[i].name; i++)
seq_printf(seq, " %lu", buff[i]);
seq_putc(seq, '\n');
return 0;
}
开发者ID:SantoshShilimkar,项目名称:linux,代码行数:49,代码来源:proc.c
示例5: seq_print_vma_name
static void seq_print_vma_name(struct seq_file *m, struct vm_area_struct *vma)
{
const char __user *name = vma_get_anon_name(vma);
struct mm_struct *mm = vma->vm_mm;
unsigned long page_start_vaddr;
unsigned long page_offset;
unsigned long num_pages;
unsigned long max_len = NAME_MAX;
int i;
page_start_vaddr = (unsigned long)name & PAGE_MASK;
page_offset = (unsigned long)name - page_start_vaddr;
num_pages = DIV_ROUND_UP(page_offset + max_len, PAGE_SIZE);
seq_puts(m, "[anon:");
for (i = 0; i < num_pages; i++) {
int len;
int write_len;
const char *kaddr;
long pages_pinned;
struct page *page;
pages_pinned = get_user_pages(current, mm, page_start_vaddr,
1, 0, 0, &page, NULL);
if (pages_pinned < 1) {
seq_puts(m, "<fault>]");
return;
}
kaddr = (const char *)kmap(page);
len = min(max_len, PAGE_SIZE - page_offset);
write_len = strnlen(kaddr + page_offset, len);
seq_write(m, kaddr + page_offset, write_len);
kunmap(page);
put_page(page);
/* if strnlen hit a null terminator then we're done */
if (write_len != len)
break;
max_len -= len;
page_offset = 0;
page_start_vaddr += PAGE_SIZE;
}
seq_putc(m, ']');
}
开发者ID:sztablet2016,项目名称:Android-kernel-msm-3.10,代码行数:49,代码来源:task_mmu.c
示例6: kbasep_mem_profile_seq_show
/** Show callback for the @c mem_profile debugfs file.
*
* This function is called to get the contents of the @c mem_profile debugfs
* file. This is a report of current memory usage and distribution in userspace.
*
* @param sfile The debugfs entry
* @param data Data associated with the entry
*
* @return 0 if successfully prints data in debugfs entry file
* -1 if it encountered an error
*/
static int kbasep_mem_profile_seq_show(struct seq_file *sfile, void *data)
{
struct kbase_context *kctx = sfile->private;
KBASE_DEBUG_ASSERT(kctx != NULL);
spin_lock(&kctx->mem_profile_lock);
if (kctx->mem_profile_data) {
seq_write(sfile, kctx->mem_profile_data, kctx->mem_profile_size);
seq_putc(sfile, '\n');
}
spin_unlock(&kctx->mem_profile_lock);
return 0;
}
开发者ID:MEHDIMYADI,项目名称:kernel_samsung_exynos5422,代码行数:26,代码来源:mali_kbase_mem_profile_debugfs.c
示例7: show_interrupts
int show_interrupts(struct seq_file *p, void *v)
{
int i = *(loff_t *) v, j;
struct irqaction * action;
unsigned long flags;
if (i == 0) {
char cpuname[16];
seq_printf(p, " ");
for_each_online_cpu(j) {
snprintf(cpuname, 10, "CPU%d", j);
seq_printf(p, "%10s ", cpuname);
}
seq_putc(p, '\n');
}
开发者ID:BinVul,项目名称:linux2.6.32,代码行数:15,代码来源:irq.c
示例8: proc_seq_show
static int proc_seq_show(struct seq_file *s, void *v)
{
printk("show\n");
//return 0;
tmp_v = ((struct task_struct *)v);
int i=0;
for(i=0;i<30;i++)
{
seq_printf(s, "%d,%30s", tmp_v->pid,tmp_v->comm);
seq_putc(s, '\n');
}
return 0;
}
开发者ID:Winddoing,项目名称:RTFSC_Linux_Kernel,代码行数:15,代码来源:seq_file.c
示例9: exp_seq_show
static int exp_seq_show(struct seq_file *s, void *v)
{
struct ip_conntrack_expect *expect = v;
if (expect->timeout.function)
seq_printf(s, "%lu ", timer_pending(&expect->timeout)
? (expect->timeout.expires - jiffies)/HZ : 0);
else
seq_printf(s, "- ");
seq_printf(s, "proto=%u ", expect->tuple.dst.protonum);
print_tuple(s, &expect->tuple,
ip_ct_find_proto(expect->tuple.dst.protonum));
return seq_putc(s, '\n');
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:16,代码来源:ip_conntrack_standalone.c
示例10: show_interrupts
int show_interrupts(struct seq_file *p, void *v)
{
int i = *(loff_t *) v, cpu;
struct irqaction * action;
unsigned long flags;
if (i == 0) {
char cpuname[12];
seq_printf(p, " ");
for_each_present_cpu(cpu) {
sprintf(cpuname, "CPU%d", cpu);
seq_printf(p, " %10s", cpuname);
}
seq_putc(p, '\n');
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:16,代码来源:irq.c
示例11: task_name
static inline void task_name(struct seq_file *m, struct task_struct *p)
{
char *buf;
size_t size;
char tcomm[sizeof(p->comm)];
int ret;
get_task_comm(tcomm, p);
seq_puts(m, "Name:\t");
size = seq_get_buf(m, &buf);
ret = string_escape_str(tcomm, buf, size, ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\");
seq_commit(m, ret < size ? ret : -1);
seq_putc(m, '\n');
}
开发者ID:020gzh,项目名称:linux,代码行数:17,代码来源:array.c
示例12: task_name
static inline void task_name(struct seq_file *m, struct task_struct *p)
{
char *buf;
char tcomm[sizeof(p->comm)];
get_task_comm(tcomm, p);
seq_puts(m, "Name:\t");
buf = m->buf + m->count;
/* Ignore error for now */
string_escape_str(tcomm, &buf, m->size - m->count,
ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\");
m->count = buf - m->buf;
seq_putc(m, '\n');
}
开发者ID:Abioy,项目名称:kasan,代码行数:17,代码来源:array.c
示例13: arch_show_interrupts
int arch_show_interrupts(struct seq_file *p, int prec)
{
int j;
#ifdef CONFIG_SMP
seq_puts(p, "IPI: ");
for_each_online_cpu(j)
seq_printf(p, "%10lu ", cpu_data[j].ipi_count);
seq_putc(p, '\n');
#endif
seq_puts(p, "PMI: ");
for_each_online_cpu(j)
seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j));
seq_puts(p, " Performance Monitoring\n");
seq_printf(p, "ERR: %10lu\n", irq_err_count);
return 0;
}
开发者ID:007kumarraja,项目名称:rockchip-rk3188-mk908,代码行数:17,代码来源:irq.c
示例14: show_console_dev
/*
* This is handler for /proc/consoles
*/
static int show_console_dev(struct seq_file *m, void *v)
{
static const struct {
short flag;
char name;
} con_flags[] = {
{ CON_ENABLED, 'E' },
{ CON_CONSDEV, 'C' },
{ CON_BOOT, 'B' },
{ CON_PRINTBUFFER, 'p' },
{ CON_BRL, 'b' },
{ CON_ANYTIME, 'a' },
};
char flags[ARRAY_SIZE(con_flags) + 1];
struct console *con = v;
unsigned int a;
dev_t dev = 0;
if (con->device) {
const struct tty_driver *driver;
int index;
driver = con->device(con, &index);
if (driver) {
dev = MKDEV(driver->major, driver->minor_start);
dev += index;
}
}
for (a = 0; a < ARRAY_SIZE(con_flags); a++)
flags[a] = (con->flags & con_flags[a].flag) ?
con_flags[a].name : ' ';
flags[a] = 0;
seq_setwidth(m, 21 - 1);
seq_printf(m, "%s%d", con->name, con->index);
seq_pad(m, ' ');
seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-',
con->write ? 'W' : '-', con->unblank ? 'U' : '-',
flags);
if (dev)
seq_printf(m, " %4d:%d", MAJOR(dev), MINOR(dev));
seq_putc(m, '\n');
return 0;
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:48,代码来源:consoles.c
示例15: c_show
static int c_show(struct seq_file *m, void *p)
{
struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list);
seq_printf(m, "name : %s\n", alg->cra_name);
seq_printf(m, "driver : %s\n", alg->cra_driver_name);
seq_printf(m, "module : %s\n", module_name(alg->cra_module));
seq_printf(m, "priority : %d\n", alg->cra_priority);
seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt));
seq_printf(m, "selftest : %s\n",
(alg->cra_flags & CRYPTO_ALG_TESTED) ?
"passed" : "unknown");
if (alg->cra_flags & CRYPTO_ALG_LARVAL) {
seq_printf(m, "type : larval\n");
seq_printf(m, "flags : 0x%x\n", alg->cra_flags);
goto out;
}
if (alg->cra_type && alg->cra_type->show) {
alg->cra_type->show(m, alg);
goto out;
}
switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) {
case CRYPTO_ALG_TYPE_CIPHER:
seq_printf(m, "type : cipher\n");
seq_printf(m, "blocksize : %u\n", alg->cra_blocksize);
seq_printf(m, "min keysize : %u\n",
alg->cra_cipher.cia_min_keysize);
seq_printf(m, "max keysize : %u\n",
alg->cra_cipher.cia_max_keysize);
break;
case CRYPTO_ALG_TYPE_COMPRESS:
seq_printf(m, "type : compression\n");
break;
default:
seq_printf(m, "type : unknown\n");
break;
}
out:
seq_putc(m, '\n');
return 0;
}
开发者ID:Ntemis,项目名称:Bexus-N,代码行数:45,代码来源:proc.c
示例16: rfs_rule_proc_show
/*
* rfs_rule_proc_show
* show RFS rules in proc
*/
static int rfs_rule_proc_show(struct seq_file *m, void *v)
{
int index;
int count = 0;
struct hlist_head *head;
struct rfs_rule_entry *re;
struct rfs_rule *rr = &__rr;
seq_printf(m, "RFS rule table:\n");
rcu_read_lock();
for ( index = 0; index < RFS_RULE_HASH_SIZE; index++) {
head = &rr->hash[index];
hlist_for_each_entry_rcu(re, head, hlist) {
seq_printf(m, "%03d %04x", ++count, index);
if (re->type == RFS_RULE_TYPE_MAC_RULE)
seq_printf(m, " MAC: %pM cpu %d", re->mac, re->cpu);
else if (re->type == RFS_RULE_TYPE_IP4_RULE)
seq_printf(m, " IP: %pI4 cpu %d", &re->u.ip4addr, re->cpu);
else
seq_printf(m, " IP: %pI6 cpu %d", &re->u.ip4addr, re->cpu);
if (re->is_static)
seq_printf(m, " static");
else
seq_printf(m, " dynamic");
if (re->type == RFS_RULE_TYPE_MAC_RULE)
seq_printf(m, " hvid %d", re->hvid);
if (re->nvif) {
int i;
seq_printf(m, " ifvid");
for (i = 0; i < re->nvif; i++) {
seq_printf(m, " %d", re->ifvid[i]);
if (re->type != RFS_RULE_TYPE_MAC_RULE) {
seq_printf(m, "@%pM", &re->ifmac[ETH_ALEN * i]);
}
}
}
seq_putc(m, '\n');
}
}
开发者ID:OpenHUE,项目名称:bsb002-lklm_qca-rfs,代码行数:49,代码来源:rfs_rule.c
示例17: nommu_vma_show
/*
* display a single VMA to a sequenced file
*/
static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
int is_pid)
{
struct mm_struct *mm = vma->vm_mm;
struct proc_maps_private *priv = m->private;
unsigned long ino = 0;
struct file *file;
dev_t dev = 0;
int flags;
unsigned long long pgoff = 0;
flags = vma->vm_flags;
file = vma->vm_file;
if (file) {
struct inode *inode = file_inode(vma->vm_file);
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
}
seq_setwidth(m, 25 + sizeof(void *) * 6 - 1);
seq_printf(m,
"%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu ",
vma->vm_start,
vma->vm_end,
flags & VM_READ ? 'r' : '-',
flags & VM_WRITE ? 'w' : '-',
flags & VM_EXEC ? 'x' : '-',
flags & VM_MAYSHARE ? flags & VM_SHARED ? 'S' : 's' : 'p',
pgoff,
MAJOR(dev), MINOR(dev), ino);
if (file) {
seq_pad(m, ' ');
seq_file_path(m, file, "");
} else if (mm && is_stack(priv, vma, is_pid)) {
seq_pad(m, ' ');
seq_printf(m, "[stack]");
}
seq_putc(m, '\n');
return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:47,代码来源:task_nommu.c
示例18: svc_info
static void svc_info(struct seq_file *seq, struct atm_vcc *vcc)
{
if (!vcc->dev)
seq_printf(seq, sizeof(void *) == 4 ?
"N/[email protected]%pK%10s" : "N/[email protected]%pK%2s", vcc, "");
else
seq_printf(seq, "%3d %3d %5d ",
vcc->dev->number, vcc->vpi, vcc->vci);
seq_printf(seq, "%-10s ", vcc_state(vcc));
seq_printf(seq, "%s%s", vcc->remote.sas_addr.pub,
*vcc->remote.sas_addr.pub && *vcc->remote.sas_addr.prv ? "+" : "");
if (*vcc->remote.sas_addr.prv) {
int i;
for (i = 0; i < ATM_ESA_LEN; i++)
seq_printf(seq, "%02x", vcc->remote.sas_addr.prv[i]);
}
seq_putc(seq, '\n');
}
开发者ID:adyjl,项目名称:DORIMANX_LG_STOCK_LP_KERNEL,代码行数:19,代码来源:proc.c
示例19: lastlog_m_show
static int lastlog_m_show(struct seq_file *s, void *v)
{
const char priority_chars[] = {'?', '?', 'V', 'D', 'I','W','E', 'F', 'S'};
struct logger_entry *entry = v;
struct logger_entry tmp;
char* tagaddr;
char *msgaddr;
struct rtc_time rtctime;
int priority;
int err = 0;
memcpy (&tmp, entry, sizeof(tmp));
rtctime = rtc_ktime_to_tm(ktime_set (tmp.sec, tmp.nsec));
priority = entry->msg[0];
tagaddr = &(entry->msg[1]);
msgaddr = tagaddr + strlen(tagaddr) + 1;
err = seq_printf (s, "%02d-%02d %02d:%02d:%02d.%03d %c/%-8s(%5d:%d): ",
rtctime.tm_mon + 1, rtctime.tm_mday, rtctime.tm_hour,
rtctime.tm_min, rtctime.tm_sec + 1,
tmp.nsec / 1000000, priority_chars[priority],
tagaddr, tmp.pid, tmp.tid);
if (err != 0)
goto err;
if (entry->msg[tmp.len-1] == '\0') {
err = seq_printf (s, "%s", msgaddr);
} else {
err = seq_write (s, msgaddr, tmp.len - (msgaddr - entry->msg));
}
if (err != 0)
goto err;
if (s->buf[s->count-1] != '\n')
err = seq_putc(s, '\n');
if (err != 0)
goto err;
return 0;
err:
return -1;
}
开发者ID:djselbeck,项目名称:sailfishos_kernel_jolla_msm8930,代码行数:43,代码来源:lastlog.c
示例20: nommu_region_show
/*
* display a single region to a sequenced file
*/
static int nommu_region_show(struct seq_file *m, struct vm_region *region)
{
unsigned long ino = 0;
struct file *file;
dev_t dev = 0;
int flags, len;
flags = region->vm_flags;
file = region->vm_file;
if (file) {
struct inode *inode = region->vm_file->f_path.dentry->d_inode;
if (region->vm_prfile) {
file = region->vm_prfile;
inode = file->f_path.dentry->d_inode;
}
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
}
seq_printf(m,
"%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
region->vm_start,
region->vm_end,
flags & VM_READ ? 'r' : '-',
flags & VM_WRITE ? 'w' : '-',
flags & VM_EXEC ? 'x' : '-',
flags & VM_MAYSHARE ? flags & VM_SHARED ? 'S' : 's' : 'p',
((loff_t)region->vm_pgoff) << PAGE_SHIFT,
MAJOR(dev), MINOR(dev), ino, &len);
if (file) {
len = 25 + sizeof(void *) * 6 - len;
if (len < 1)
len = 1;
seq_printf(m, "%*c", len, ' ');
seq_path(m, &file->f_path, "");
}
seq_putc(m, '\n');
return 0;
}
开发者ID:daivietpda,项目名称:android_kernel_huawei_msm7x27,代码行数:45,代码来源:nommu.c
注:本文中的seq_putc函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论