Lines Matching defs:pmsg
806 struct printk_message pmsg = {
815 if (!printk_get_next_message(&pmsg, atomic64_read(&user->seq), true, false)) {
832 printk_get_next_message(&pmsg, atomic64_read(&user->seq), true,
838 if (pmsg.dropped) {
840 atomic64_set(&user->seq, pmsg.seq);
845 atomic64_set(&user->seq, pmsg.seq + 1);
847 if (pmsg.outbuf_len > count) {
852 if (copy_to_user(buf, outbuf, pmsg.outbuf_len)) {
856 ret = pmsg.outbuf_len;
2253 static void pmsg_load_execution_ctx(struct printk_message *pmsg,
2256 pmsg->cpu = printk_info_get_cpu(info);
2257 pmsg->pid = printk_info_get_pid(info);
2258 memcpy(pmsg->comm, info->comm, sizeof(pmsg->comm));
2259 static_assert(sizeof(pmsg->comm) == sizeof(info->comm));
2264 static void pmsg_load_execution_ctx(struct printk_message *pmsg,
2938 * Prepend the message in @pmsg->pbufs->outbuf. This is achieved by shifting
2941 * @pmsg is the original printk message.
2944 * If there is not enough space in @pmsg->pbufs->outbuf, the existing
2947 * If @pmsg->pbufs->outbuf is modified, @pmsg->outbuf_len is updated.
2950 static void console_prepend_message(struct printk_message *pmsg, const char *fmt, ...)
2952 struct printk_buffers *pbufs = pmsg->pbufs;
2973 if (pmsg->outbuf_len + len >= outbuf_sz) {
2975 pmsg->outbuf_len = outbuf_sz - (len + 1);
2976 outbuf[pmsg->outbuf_len] = 0;
2979 memmove(outbuf + len, outbuf, pmsg->outbuf_len + 1);
2981 pmsg->outbuf_len += len;
2985 * Prepend the message in @pmsg->pbufs->outbuf with a "dropped message".
2986 * @pmsg->outbuf_len is updated appropriately.
2988 * @pmsg is the printk message to prepend.
2992 void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped)
2994 console_prepend_message(pmsg, "** %lu printk messages dropped **\n", dropped);
2998 * Prepend the message in @pmsg->pbufs->outbuf with a "replay message".
2999 * @pmsg->outbuf_len is updated appropriately.
3001 * @pmsg is the printk message to prepend.
3003 void console_prepend_replay(struct printk_message *pmsg)
3005 console_prepend_message(pmsg, "** replaying previous printk message **\n");
3012 * @pmsg will contain the formatted result. @pmsg->pbufs must point to a
3024 * of @pmsg are valid. (See the documentation of struct printk_message
3025 * for information about the @pmsg fields.)
3027 bool printk_get_next_message(struct printk_message *pmsg, u64 seq,
3030 struct printk_buffers *pbufs = pmsg->pbufs;
3055 pmsg->seq = r.info->seq;
3056 pmsg->dropped = r.info->seq - seq;
3058 pmsg_load_execution_ctx(pmsg, r.info);
3075 pmsg->outbuf_len = len;
3130 struct printk_message pmsg = {
3137 if (!printk_get_next_message(&pmsg, con->seq, is_extended, true))
3140 con->dropped += pmsg.dropped;
3143 if (pmsg.outbuf_len == 0) {
3144 con->seq = pmsg.seq + 1;
3149 console_prepend_dropped(&pmsg, con->dropped);
3163 con->write(con, outbuf, pmsg.outbuf_len);
3164 con->seq = pmsg.seq + 1;
3183 con->write(con, outbuf, pmsg.outbuf_len);
3188 con->seq = pmsg.seq + 1;